Posts by Fleuquer Lima • 578 points
22 posts
-
1
votes3
answers203
viewsQ: Combine arrays
Well, I’ll try to explain a little better as you requested. I own 3 arrays simple, I’m using an example with 3 arrays, but actually the number of arrays is not defined as they are mounted from…
-
1
votes5
answers14748
viewsQ: Take part of a string delimited between characters
I have a string as in the example below: $string = 'Lorem ipsum dolor sit amet, consectetur /adipiscing elit/.'; My question is, how can I only get the part of the text that’s between the bars /,…
-
1
votes2
answers67
viewsA: how to place this in an html document
Basically just use the tags. To start everything would have to be between the tags <html></html> (Remembering that to indicate the end of a tag HTML is used </). With the <html>…
htmlanswered Fleuquer Lima 578 -
3
votes1
answer2233
viewsQ: Count element values from a PHP array
I got the following array, for example: Array ( [0] => Array ( [ID] => 401675295 [DATA] => 2016-06-28 15:33:07 [TITULO] => Teste [TEXTO] => [TIPO] => 4 [NOME] => JOAO ) [1]…
-
0
votes1
answer279
viewsA: Mirror HTML page with Frames
I kept thinking about the functionality of this and good, let’s try to answer.. First let’s define some things, which I see are not very clear, taking into account the type of question. What is…
htmlanswered Fleuquer Lima 578 -
2
votes3
answers711
viewsA: Split form with radios in 2 columns
To list side by side you would have to set a width because the div comes by default with 100% width, thus occupying all the space and passing to the next line. As the div which lies the radios is…
-
0
votes3
answers69
viewsA: Loop of DIV’s in PHP
Well, if you’re already on loop, just check which is the first position with a IF: <?php for($i=1;$i<=5;$i++): ?> <?php if($i == 1): ?> // Faz o que precisa na primeira posição…
-
6
votes1
answer208
viewsA: Help with step email form
You see, a SESSION may be used by any of its pages, provided that it has a session_start(). The point is, you’re setting a new value for Sesssions on all your pages, so the value that should be…
-
2
votes5
answers40467
viewsA: How to redirect php pages
To redirect according to the profile you can do: if($perfil == 0) header('Location: /pagina_perfil_0.php'); elseif($perfil == 1) header('Location: /pagina_perfil_1.php'); Or so: switch ($perfil) {…
-
0
votes2
answers62
viewsA: Access matrix within function
Well I don’t know if I could explain it properly from the comments so let’s go. What happens in your code is this, you’re using functions correct? Then the variable you created in the function…
phpanswered Fleuquer Lima 578 -
3
votes1
answer561
viewsQ: Class with more than one __constructor in PHP?
I was here studying a little more about builders in PHP. And I ran into some questions. 1 - It is possible for a class to have more than one constructor? 2 - If yes, how to know which one will be…
-
3
votes2
answers70
viewsQ: Set values inside or outside the method?
I’m studying about passing parameters in PHP. I want, for example, to use a certain method that needs to receive two values, I have the following codes: Example 1 In the class: class Exemplo {…
-
1
votes2
answers224
viewsA: Display content (only once) after X repetitions in PHP
You can use a loop for or while for repeats and use a if to check the position of the counter with the rray placed in the comments: Example for for: <?php for ($i=0; $i <$repetições ; $i++):…
phpanswered Fleuquer Lima 578 -
0
votes2
answers544
viewsQ: How to add options to a drop-down list using jQuery?
I have a role in jQuery who receives a array from PHP, through the $.post. The array comes like this: array( '0' => array( 'ID' => '1', 'NOME' => 'João' ), '1' => array( 'ID' => '2',…
-
5
votes2
answers912
viewsQ: Good practices for PHP MVC
I am deepening on the use of MVC using PHP, and after seeing some lessons and articles on the Internet I had some doubts about its use, since I found classes that present the same case differently.…
-
0
votes1
answer339
viewsA: Scroll through an array and separate the same names to make the appropriate changes
Well, if I understand you correctly, I believe that’s it, you can use a combination of for and if to know when to make the appropriate changes. Using your example: $MeuArray = array("PEDRO" ,"PEDRO"…
-
2
votes2
answers2062
viewsA: Find next multiple of 10 of a number in php
Good afternoon. Well I don’t know if there’s a specific function for that, but you can do it this way using the ceil, and a simple mathematical logic. Example: $num = 142; $arredondado =…
phpanswered Fleuquer Lima 578 -
1
votes3
answers1151
viewsA: Make it difficult to access CSS and JS files
The PHP files are "locked" to the end user because they run on the server side, as well as the information in the database, so everything you have in PHP is done/compiled by the server and sent to…
-
0
votes1
answer163
viewsA: Select inside of Select
You can do it in the same Query yes. You can make the comparison directly by adding the two tables and giving them nicknames with "AS", and when calling the fields just put the nickname in front to…
-
2
votes2
answers2095
viewsA: CNPJ query using PHP
The result is appearing like this because you are using the "var_dump". This function will show a structured representation over one or more expressions, including type and value. In your case your…
-
3
votes1
answer99
viewsA: PHP Arrays and Strings Interface
I think you’re confusing that "string(n)" that appears shows only the size of the characters that are within each index of the array. If I understand correctly, I believe you are wanting to show a…
-
0
votes1
answer96
viewsA: Paging in SQL
Well if you want to find out just the page (assuming you already know what position the user/player is in), you can use a simple math function in PHP itself. For example, if you are showing 50…