Posts by sadlyblue • 275 points
6 posts
-
-1
votes2
answers68
viewsA: PHP - How to add content to the log?
I would use Try/catch along with file_put_contents to save the data. For example: try { function_que_pode_dar_erro(); } catch (Exception $e) { file_put_contents('logfile.log', 'Caught exception: ',…
-
0
votes2
answers61
viewsA: Total Input radio PHP
the problem of not working on this page is that Document.Forms[0]; return the first form of the page, in this case, the survey form. assign an id to the form you want to do the math, or put (since…
-
4
votes1
answer746
viewsA: Loop in json that returns all records
In.php search, you are only returning the first result. It has to loop as it does for select options and create an array (I chose to create only with the name, because in javascript you were only…
-
1
votes1
answer313
viewsA: How to identify elements with repeated values in an array and create a new array
Can use: $resultado = array(); foreach($array as $a){ if(isset($resultado[$a['num']])) $resultado[$a['num']]['totalparcial'] += $a['totalparcial']; else $resultado[$a['num']] = $a; } If you need…
-
-1
votes2
answers68
viewsA: Search id returned from json_encode() inside mysql
From what I’ve seen in the documentation, try to use: $this->db->get_where('produto', array('pro_are_id', 1))->result(); Uncalled for $this->db->like("pro_are_id", $area);…
-
-1
votes2
answers1095
viewsA: How to take values within multiple tags
Ideal is to use preg_match_all. function capturar($string, $start, $end) { $start = str_replace('/', '\/', $start); $end = str_replace('/', '\/', $end); preg_match_all('/'.$start.'(.*?)'.$end.'/',…