Questions tagged as 'php'

2
answers

How to detect 3 equal numbers?

I have a For loop that has two mt_rand , one of random numbers and another mt_rand of numbers that are designated as prizes. What I want to do now is check out 3 equal numbers, make the sum of the values that came out in t...
asked by 11.01.2017 / 11:25
2
answers

Point to a folder before DOCUMENT ROOT?

Below is the structure of the folders: /home/web/site/public_html If I give echo $_SERVER['DOCUMENT_ROOT'] I'm going to get the path to public_html, but I'd like to leave some inaccessible files directly through the URL so I'm putt...
asked by 19.01.2017 / 13:41
1
answer

Print 2 records per page with Mpdf

My problem is this: I need to print duplicates. I am using to generate the pdf Mpdf . When I need to emit only one blz, it works perfectly, but when I need to print more, it cuts, it gets one part on the first page and the second on the en...
asked by 13.01.2017 / 21:32
2
answers

Xdebug in Xampp

I'm having trouble activating xdebug in xampp, since I can not find the directives in xampp to configure xdebug. How do I add the xdebug extension in xampp's php.ini?     
asked by 02.10.2016 / 22:08
1
answer

How PDOStatement :: fetchObject works

I'm trying to set the values returned from a query to an object of another class as follows: public function select($id,Cliente $cliente) { $query = "SELECT * FROM compras WHERE id = :id AND email = :email"; $stm = $this->conexao-&g...
asked by 07.10.2016 / 18:21
2
answers

How to avoid excessive line breaks in a textarea

So guys, how can I replace excessive line breaks in a text, so that when I have more than one line break followed these occurrences are replaced by one, regardless of how many were placed. For example: The text entered by the user: <te...
asked by 30.09.2016 / 20:55
2
answers

Using PING with PHP

I have a function that needs to ping 5 machines on the internal network. I am using the command below: //EXECUTA O PING exec("ping " . $host, $output, $result); What happens is as follows. If I put a non-standard ip, such as "192.999.999....
asked by 13.10.2016 / 13:28
1
answer

SELECT Union ALL Dismiss Arguments

I have this query that adds two results to different tables. SELECT sum(g) saldo_anterior from ( SELECT SUM(valor_pg) g FROM ctrl_deposito WHERE MONTH(data_pg) < 11 and YEAR(data_pg) <= 2016 or YEAR(...
asked by 17.07.2017 / 14:13
1
answer

Display only a maximum number of characters

My question, I think, is quite simple, how can I do to display only a maximum number of characters for the user, for example 25 characters + "..." The idea is to limit the characters of these texts, so that the sizes of the div's do not...
asked by 04.08.2017 / 21:34
1
answer

I get different results when I convert from Character to Decimal in PHP and Java

When I convert á to decimal I get the result 225 with this code in Java: public static int charToDec(String text){return (int) text.charAt(0);} When I convert á to decimal I get the result 195 with this code in P...
asked by 29.07.2017 / 23:16