Questions tagged as 'php'

5
answers

how can I include a variable inside double quotes

$articulos= $conexion->prepare( 'SELECT SQL_CALC_ROWS * FROM articulos LIMIT $inicio, $postPorPaginas' ); When it's like this inside php, it appears to me as if it were a simple string although I have declared the varible with it...
asked by 23.01.2018 / 20:13
1
answer

Is it possible to generate JSON from Javascript?

Is there any way to do the JSON encode that is in PHP, but from JavaScript or jQuery? I need to pass an array that I create from JavaScript through an Ajax connection that I send by POST, and then this request is transformed by PHP into a GET...
asked by 21.06.2016 / 13:17
3
answers

Separate and extract elements of a string with numbers and letters!

How can I extract certain elements from a chain? example: $cadena="11d08mo2016y"; from which I need to extract only the given numbers of x string separately, thus remaining! $cadena[0]=11 $cadena[1]=08 $cadena[2]=2016 I was trying the...
asked by 15.11.2017 / 15:27
1
answer

Connection error mysqli [closed]

I have a problem with the following code. It seems that the connection is not closed or gives an error. The error it shows is:    Notice: Undefined variable: mysqli_close in   C: \ xampp \ htdocs \ new \ 89_Blog1 \ insertContent.php on line 2...
asked by 06.06.2017 / 17:15
1
answer

Create a template / master page in php language [closed]

How can I create the structure of a master / template in PHP with alternatives other than include and require independently of content and design , thanks in advance. for example a menu that can be visible in all the files and right there...
asked by 03.10.2016 / 23:17
4
answers

Keep the 0 on the left

My program ignores me 0 on the left, example pass 001 and take it as 1 and I need everything complete. My code goes like this function rotate_to_max($n): int { echo "El numero inicial es ".$n."\n"; $vec = array(); while($n != 0...
asked by 25.11.2016 / 04:05
2
answers

Modal with Bootstrap calls link in PHP from MySQL

Good morning, I wanted to consult the following: When generating a modal with Bootstrap and calling from the database, it generates the modal , but even though there is a lot of data, it always shows me the first one it takes....
asked by 07.01.2016 / 04:07
2
answers

Slow query PHP MySQL

I have a problem of slowness when making a query to the bd, it is from a friend's website and I do not have much idea of php but the section that makes the query is the following code. function get($id_usuario=false){ global $wpdb;...
asked by 05.06.2017 / 19:14
3
answers

Difference between $ value == null and null == $ value

What is the difference of putting the null in front of or behind the variable that we are comparing, that is, what is the difference between: if ($value==null){...} and if (null==$value){...} I've heard that the second option is...
asked by 04.04.2018 / 18:39
4
answers

What does (string) $ max! = 'INF' mean?

Does anyone help me understand this? I was practicing with PHP, I came across this code. I'm trying to solve it: function float_max( $mul = 2, $affine = 1 ) { $max = 1; $omax = 0; while( (string) $max != 'INF' ) { $om...
asked by 02.07.2017 / 08:27