Questions tagged as 'php'

2
answers

How to separate words from a string?

How do I separate words from this string into separate variables with PHP? I'd like to do something like this: $frase = "O + rato + roeu + a + roupa + do + rei + de + roma"; for(i=1; i<=**numero de palavras**; i++) { $palavra + i...
asked by 11.11.2016 / 17:24
2
answers

PHP catching CloudFlare IP instead of user IP

I'm having a problem using the: $_SERVER["REMOTE_ADDR"]; eventually it takes an IP that is not the user's, in case it started after I started using CloudFlare ... Does anyone know why this happens? Is there a better way to get the...
asked by 12.01.2017 / 03:25
2
answers

Reversing FILTER_SANITIZE_SPECIAL_CHARS

I took a variable and converted it using FILTER_SANITIZE_SPECIAL_CHARS . Example: filter_var ("hug' o", FILTER_SANITIZE_SPECIAL_CHARS); The result: hugD&#39; o How do I reverse this?     
asked by 23.08.2016 / 21:26
2
answers

How to install the PDO_PGSQL driver in ubuntu?

I have already installed PHP 7, Apache 2 and Postgresql 9.5. I have already enabled the extension in php.ini but it does not work. In Windows just enable this extension in php.ini that already works but here in Ubuntu was not...
asked by 13.09.2016 / 17:44
2
answers

Show Total Records

Personal Talk, I am developing a system for videoconferences and this should include a Dashboard with some information, such as the total of videoconferences of the current day, the next day and the amount of VIP videoconferences. To show the...
asked by 22.07.2018 / 16:58
2
answers

What is the difference between using password_default and password_bcrypt?

Searching for hash, I noticed that the second parameter of the password_hash function has two options, PASSWORD_DEFAULT and PASSWORD_BCRYPT , Exactly which of the two should I give preference to use? It should probably...
asked by 04.04.2017 / 15:40
1
answer

What is the iterable type of PHP 7.1?

I was looking at some code to test PHP 7.1 and found the following snippet: function doLoop(iterable $iterable) { foreach ($iterable as $value) { echo $value; } } $data = [1, 2, 3, 4]; doLoop($data); With iterable I...
asked by 10.04.2017 / 03:15
1
answer

What is a template engine?

Little by little, I learned about the template engine in PHP. By the way, I understood what it is, but I have doubts. Is it a "programming language?" I put quotation marks on a website:    Purpose       At first, a template language or...
asked by 17.07.2017 / 16:03
1
answer

How to post to a facebook page using PHP

I would like to know how to make automatic postings on a particular facebook page using PHP. I consulted the documentation that facebook offers and besides being in English I also did not understand enough to assemble the script. I already have...
asked by 19.02.2015 / 02:12
1
answer

Invert while results

Is there a function in PHP that allows me to reverse the order of results of a while ? For example, I have the following code that checks for a URL. <?php function url_exists($url) { $ch = curl_init($url); curl_setopt($ch,...
asked by 14.01.2015 / 16:46