Questions tagged as 'php'

2
answers

How to send an Array via POST to a PHP controller

I need to pass an array via POST to my PHP controller, the only way I have in mind is not to pass an array, but to pass the information through a separator (,; |), but I did not want to have to keep blowing up the other side (Controller). At...
asked by 27.02.2014 / 22:06
3
answers

How to transform a query into a json?

I'm trying to transform the data returned from a database query in Json format, so far it's almost right, but I believe the format is being created incorrectly! json is being generated as follows! [{"codigo":"1","nome":"Lucas Marioano Perei...
asked by 17.04.2014 / 15:38
2
answers

How to check for errors in an XML

I'm using the simplexml_load_string function to load a dynamic XML, but if there are formatting errors in this XML it only returns me false and I do not know where the error is, can I check this?     
asked by 02.01.2014 / 14:21
2
answers

How do I check real-time registration?

I have a registration system that I need to verify in real time if the email exists in the database. But the same is not working, in <div id="resposta"></div> does not display any result. JavaScript <script langua...
asked by 09.08.2018 / 23:57
2
answers

Why use only return, without returning any data?

Studying the code of a framework I came across the following code snippet: if (file_exists('lib/util/' . $className . '.php')) { include 'lib/util/' . $className . '.php'; return; } What is the purpose of using return wit...
asked by 28.05.2016 / 15:42
2
answers

Is there any way to break?

I wanted to know if there is any kind of 'break' in IF . My question is based on the example below. When the b() function returns false all subsequent comparisons are not performed. I thought the condition would compare all t...
asked by 21.09.2016 / 16:00
2
answers

How do I make mysql_num_rows of multiple results

Well, what I want is the following: I have 1 table designated by items, in this table I have 4 columns: name iditem (Unique ID) numerobot What I want to do is: I want to make a mysql_num_rows of all results, but for each different...
asked by 15.02.2017 / 01:12
1
answer

What is a binary-safe function? And what are your applications?

I was browsing through the php.net manual when I came across the following note about function str_replace :   Note:Thisfunctionisbinary-safe.Igavea searched here on the net and found nothing about it. What is a binary-safe func...
asked by 16.01.2017 / 23:28
2
answers

Count black pixels of an image region

I have the following question: I have a script that I can select the coordinates of an area of an image: link Considering that I have a binária ( black and white ) image, how do I count the amount of black pixels in a certain...
asked by 11.10.2016 / 00:28
1
answer

How to declare various conditions within an if

I have two ifs that take into account 3 conditions, one of them with multiple possibilities. I'm doing this, but it's not working: if (($var1 == $var2) && ($var3 == 1 || 3 || 5 || 7 || 8 || 12) && ($var4 > 16)) {...
asked by 06.06.2015 / 02:11