Questions tagged as 'php'

2
answers

In PHP what is this tag? =? represents? [duplicate]

In PHP what does this tag represent? Opening tag: <?= Closing Tag: ?>     
asked by 10.12.2015 / 18:31
6
answers

How to make an "alert" in PHP?

I'm doing an e-mail form in PHP, and I'm trying to make a alert when the client clicks submit a validation. The validation seems to work because it redirects to the page I want, but does not show alert . Is this code correct?...
asked by 14.03.2015 / 18:07
4
answers

Difference between prepare () and query ()?

I was doing select on a table. I went to see the result, returned false. Then I used query and it worked. What's the difference between the two? <?php $query = DB::getConn()->prepare('select * from tabela where id...
asked by 14.10.2015 / 22:37
5
answers

What are strings started with @ within PHP comments?

I was reading a code, like this: /** * PHPMailer - PHP email creation and transport class * NOTE: Requires PHP version 5 or later * @package PHPMailer * @author Andy Prevost * @author Marcus Bointon * @author Jim Jagielski * @copyright...
asked by 06.03.2017 / 18:27
2
answers

foreach can replace fetch_array?

I saw in a video that the guy takes the query and plays it right in the foreach and can list without any problem, my question is this: if it really is possible, using only the foreach would be much more practical than using while with fetch_arra...
asked by 24.07.2016 / 22:03
1
answer

How to display error when doing query?

I have the following problem, this query is not inserting data into the database: $inserir2 = mysqli_query($link, "INSERT INTO cliques (emailusuario, brasil, lucrobrasil, portugal, lucroportugal, suica, lucrosuica, belgica, lucrobelgica, austr...
asked by 21.07.2016 / 00:24
3
answers

Sort phone numbers in a string

I have some mobile numbers, fixed and fixed, in a database, I used the function implode() to join them in the same string, getting like this: (11) 3333-4353 (11) 98000-2222 (11) 3027-5555 (11) 97000-0333 What I want to do is sort th...
asked by 11.06.2017 / 23:17
2
answers

echo is printing HTML tags

I made a script for newsletter subscription, the user sends the email to cadastre.php and from there the script receives an echo in a message with a button, the problem is that the button does not appear, what appears is the tag, see : Script...
asked by 28.12.2018 / 13:41
2
answers

What is the function of this "= &" operator in PHP?

If I have the code below: $x = 1; $y = 1; if($x =& $y){ echo "ok"; }else{ echo "não"; } No matter what value I put in $x or $y , it always falls in echo "ok" . Now if I do not define one of the variables, it fal...
asked by 07.05.2018 / 01:18
1
answer

Array in PHP using () or []?

I always use the parentheses to define an array in PHP, such as: $array = array('a','b','c'); But every now and then I see some code here using brackets, like: $array = ['a', 'b', 'c']; However, if I use brackets, I get the error:  ...
asked by 01.05.2018 / 00:06