Questions tagged as 'php'

1
answer

What is the difference between Classes and Interfaces?

What is the difference between classes and interfaces ? I've read that apparently the difference in interfaces is because they are 100% public, but I have no idea. Could anyone explain the difference between them?     
asked by 28.02.2016 / 20:57
3
answers

Get the extension of a file

Hello, I tried to use pathinfo() but I think I did not use it correctly, I would like to know how to use it. $arquivo_up = $_FILES['arquivo']['name']; $extensao = pathinfo($arquivo_up); $extensao = $extensao['extension']; if($extensao...
asked by 05.05.2015 / 19:06
3
answers

In PHP, is NULL a constant or a keyword?

In PHP, is NULL a constant or a keyword? I've heard that it's a constant, but it seems like the behavior of PHP keywords (which are not case-sensitive)? Example: echo NULL; echo null; exit('teste'); EXIT('teste');     
asked by 15.07.2015 / 16:25
2
answers

How to validate Google reCaptcha / noCaptcha in PHP?

How do I submit the POST that Google requests and thus make my field validated?     
asked by 14.05.2015 / 21:32
1
answer

Compare file extension [closed]

I'm trying to compare the length of a file, but it's failing I created a variable with the extensions allowed and try to compare with the one being uploaded. // Lista de tipos de arquivos permitidos $tiposPermitidos = array('gif', 'jpeg', 'jpe...
asked by 08.07.2015 / 20:35
3
answers

Sending external PHP variable to Javascript

I need to receive a message sent from PHP, and I need to receive it on the screen, to tell you if the login is correct or not. But I do not want to use ajax. The code I'm getting in the internal script is the index: <script type="text/ja...
asked by 11.06.2015 / 14:38
2
answers

What is this class __php_incomplete_class?

I always end up discovering a lot of crazy things in this language that I love so much: PHP! What would this mysterious class __PHP_Incomplete_Class ? I accidentally "found" her when I gave her a get_declared_classes Then,...
asked by 16.07.2015 / 17:44
1
answer

Mark an image with a period

I have an image of a map and would like to put points on it. How to do?     
asked by 31.10.2014 / 13:32
1
answer

json_encode - Invalid JSON

I created a PHP code to fetch information from a database (MySQL) and "transform" into JSON. I used json_encode to do this. The output JSON seemed to be correct, but when I use some JSON validator, it always returns a Unexpected token...
asked by 14.10.2014 / 15:28
3
answers

Upload template automatically

Is it possible to program codeIgniter to load the template automatically without having to specify the views for each call in the controler? Example user controller public function listar() { $this->load->view('template/he...
asked by 17.11.2014 / 19:18