Questions tagged as 'php'

1
answer

Entrust Laravel 5.3

I've been working with Laravel Entrust for several days. It turns out that when I try to validate the roles from the routes, I get the following error: Class App\Http\Zizaco\Entrust\Middleware\EntrustRole does not exist Here is my validatio...
asked by 26.10.2016 / 20:50
4
answers

How to traverse a php fix in javascript?

I'm using laravel for a project, I present the following problem, in the controller I have an array called scaling value that is filled, then that array was sent to view using return and compact, in the view I need to pass that array to a script...
asked by 25.04.2018 / 21:52
3
answers

How to know if I am in the last iteration of a foreach

I have a function that concatenates a query from POST variables, this I do with a foreach: $id = $_POST['empId']; $query = "UPDATE userInfo SET "; foreach ($_POST as $key => $value) { $query .= "$key = '$value', "; } $query .= " WHERE i...
asked by 15.05.2018 / 21:30
3
answers

Special PHP characters

Good morning, today I come with a small problem that is this echo $consulta; to which he replies with: SELECT SUM(carrito_cant) as cantidad FROM carrito_tb WHERE carrito_folio='3041M�Ra' and carrito_NP='NA'; Devido to the character or...
asked by 10.02.2016 / 00:27
3
answers

Detect Browser language

Is there a way to detect the browser language and perform an action? For example, if the user's browser is in English, my code performs a function such as redirecting a page or displaying a message     
asked by 27.07.2017 / 03:39
4
answers

Count times an item is repeated in a php fix

Is there a function in php that returns me the number of times an element is repeated within a array ? If this is not the case, I will have to go through each element and, through a counter, see how many times it repeats. S...
asked by 03.11.2016 / 04:29
3
answers

Using JSON in PHP

I am using json-simple from Java to receive and request data in JSON format from PHP. But I do not give with the way to do the correct code from PHP to send and receive and in Java to receive. JAVA code to send and receive import org.js...
asked by 02.02.2016 / 23:40
1
answer

Creation of .zip with php

I'm trying to create a folder compressed with php at the moment it adds a single file but the idea is to be dynamic. function crear_zip($id_paciente){ $files = array( 'C:\xampp\htdocs\bitnami.txt' ); $zipname = 'C:\xampp\htdocs\zipped_...
asked by 27.12.2016 / 16:42
2
answers

Explode in PHP to separate characters

I need to make a split or explode in PHP of this string: $nombre = I_20_IH_21_23_HP_junio.jpg; I have to do 3 strings separated by I_ y _I ; H_ y _H ; P_ y . I tried to do an explode but I do not know how to...
asked by 25.04.2018 / 11:58
3
answers

How to check existence of records in mysql with php?

I'm doing a class work in which they ask me to make a record system, to insert the user's data in a database, I have the following function: function comprovaUsuari($user, $passwd){ $servername = "localhost"; $username = "root"; $d...
asked by 28.03.2018 / 12:54