Posts by hyp • 161 points
7 posts
-
0
votes2
answers30
viewsA: PHP split a variable separated by "|" and bring all results that are not empty
You can filter the values with the function array_filter() and its functions min() and max(), for the specific values. Ex: $unidades = $row->fotos; $unidades = explode("|", $unidades); $unidades…
-
1
votes4
answers191
viewsA: Assign more than one value to a checkbox
You can make a multidimensional array at the checkbox. In the former name: echo ' <tr> <td align="center">'.$skill.'</td> <td>'.$nome.'</td>…
-
2
votes1
answer176
viewsA: PHP PDO transaction with multiple objects
you need to include the connection instance before Try, so it is available in catch. require_once 'Connection.php'; $conn = new Connection(); try { $conn->connectionDB()->beginTransaction();…
-
1
votes2
answers1063
viewsA: Grab image inside Storage folder
A simpler way would be: Asset("Storage/app/public/banners/banner.png");
-
1
votes1
answer153
viewsA: Return value with Xmlhttprequest
You cannot return a value from an asynchronous function, you can use a callback function or a Promise. Ex callback: dataPacket: function(type, callback){ aTurn.packet = new XMLHttpRequest();…
-
5
votes1
answer821
viewsA: Take numbers together the letter with str_replace
The str_replace does not accept regular expression, you can use the preg_replace (). $string = preg_replace('/[0-9]+h/', '', $string);…
-
0
votes1
answer99
viewsA: Reply from PHP Excel in JSON
Parse the returned data so you have an object. $.ajax({ type : 'post', url : 'services/'+url, data : { data : competencia }, success: function (data) { //Parse do JSON retornado var obj =…