Questions tagged as 'php'

3
answers

Character manipulation in PHP

Example, we received a login this way joao.silvestre And I want to get the string with the following rule: The first letter of the name + the 7 letters that comes after the point that separates the name of the last name, for example: j...
asked by 05.01.2017 / 12:41
3
answers

How to avoid repeating the html code? [duplicate]

Good evening, folks. This is the following, I'm using the bootstrap and I would like to know how I avoid repeating the same codes in all pages, since the header and footer are the same, this would make the code more readable, I searched and sa...
asked by 19.12.2016 / 01:35
6
answers

How to display php / mysql and AngularJs data?

I'm trying to do a test with PHP + MySQL + AngularJS and I was left with a question about how to handle the bank data with angular and send to screen, I have the following codes: con-bd.php <?php .... $conn = mysqli_connect($host, $us...
asked by 14.04.2015 / 14:13
2
answers

Format php number

I have the $valor variable that returns me 10,00 I needed to format this number for 10.00 Instead of the comma , put a dot . I tried to use the function number_format($valor, 2, '.', '') but it is giv...
asked by 28.12.2016 / 17:24
2
answers

Which of these three codes is most recommended in memory and speed?

I would like to know which of these codes would be most recommended for speed, since all three do the same job: 1 $rand_length = 1; $rand_rules = range(0, 9); shuffle($rand_rules); $rand_rules = array_slice($rand_rules, 1, 9); $uni_id1 = ""...
asked by 03.02.2015 / 00:00
2
answers

Access indices of an array that is inside another array

I have the array below and I need to create a foreachs to go through it and get the product and qtd. $array = array( array( 'loja' => 'Loja1', array( array( 'p...
asked by 30.01.2018 / 21:08
3
answers

Read Array Multidimensional PHP [duplicate]

I need to read an array and get the name of its column and its value. Array: Array ( [0] => Array ( [Conta] => FRANCIELE OLIVEIRA [CPF] => '' [Telefone Res.] => (00) 0000-0000...
asked by 17.11.2017 / 19:58
7
answers

Select a file by name in PHP

Good afternoon, I need help selecting a file for its name in PHP. I use the naming pattern starting with the file creation date in the format: 20160111_ALGUMA_COISA and I need my PHP to select only the file by the part until the DATA, ignoring t...
asked by 11.01.2016 / 18:23
2
answers

How to persist $ _SESSION value in select just as it was done for input?

I'm trying to get the value of select in $_SESSION to persist the search data on a system I'm doing, but I do not know how to apply this method to select . Can you help me? I will save the variables after $_POST ......
asked by 01.01.2016 / 18:20
3
answers

How to concatenate HTML within PHP

<options += '<option value="' + j[i].CodCidade + '">' + j[i].NomeCidade + '</option>'; I have this code and I want to add one more attribute after the NameCity, if anyone can help thank you. The code is HTML generated by Java...
asked by 07.01.2016 / 03:46