Questions tagged as 'php'

2
answers

What is the finally used in PHP 5.5?

PHP 5.5 has implemented a feature (which I've heard of in other languages) called finally , in handling exceptions (along with try/catch ) We have the following example: set_error_handler(function ($errno, $errstr, $errfile, $er...
asked by 26.01.2015 / 15:42
2
answers

Is there a performance difference between "new" and "clone" in PHP?

What is the advantage of using clone instead of new to create an object in PHP? I know that to use clone it is necessary to pass an instantiated object. But because it is not necessary to "redo" the instance there is sign...
asked by 16.09.2018 / 15:34
2
answers

PHP 7 has typing arguments and return, but is optional. this is good or bad?

I would not like to raise a controversial issue here about the PHP 7 language, which was recently released, but only to understand some points about typing. Come on: In versions prior to PHP 7, the functions do not have return typing. We h...
asked by 11.01.2016 / 14:19
2
answers

What is the difference between htmlspecialchars () and htmlentities ()?

I once had to use htmlentities () to solve a certain coding situation (the words with an accent were not with the characters) and I saw that there was this htmlspecialchars (). In Php.net, I saw the following definitions:    htmlentities -...
asked by 18.01.2016 / 16:57
6
answers

How to convert UTF-8 characters in PHP

In my web application, I'm using a MySQL database that has the EditableContent table. This table has the content field, which is of type text and has the input format utf8-bin . In the database the characters appear...
asked by 19.08.2014 / 02:19
6
answers

How to write variables in PHP?

I was watching the videos of Robson V.Leite and I realized that at some point it retrieves information from the forms to insert into the database in a way different from the one I use, the only way I knew so far. It stores the variables in the f...
asked by 17.11.2015 / 14:21
4
answers

HTML / PHP Detect if form value changed

I have a form where I can change things like username , password , morada , etc. On the site I also use a session (login) for each user, which is defined by username . The problem is that by changing the form value of...
asked by 27.04.2015 / 11:35
2
answers

How to insert EMOJI - SMARTFONES in MySQL database with PHP? [duplicate]

Well, as the question is very self explanatory, I will only reinforce the question. I have an APP system of conversation, which through HTML , I command for PHP with Ajax , but if the user tries to insert some emoji in> (emotion)...
asked by 03.08.2015 / 18:16
4
answers

A means of comparing three variables

I need to make a comparison between three variables in my PHP code. if($a == $b == $c) { return true; } else { return false; } I have a lot of ideas on how to do this, but I want to know how best to achieve this.     
asked by 11.02.2014 / 19:32
3
answers

Modal form validation using Bootstrap

I have the following question. I have a simple registry and I want to register a new registry and tell me: If the field is empty it shows me the message "Fill in the fields"; If the form field already exists in the database it shows "Dupl...
asked by 21.09.2015 / 20:11