Questions tagged as 'php'

2
answers

When should I use Inheritance, Abstract Class, Interface or a Trait?

Since PHP 5.4 we have Trait , which "are mechanisms that help (and much) reuse code, and serve perfectly to solve the problem of lack of multiple inheritance." Example of Abastrata Class abstract class AbstractUser { abstract publ...
asked by 08.07.2015 / 18:07
3
answers

How do I get the value of the current percentage of an upload?

I'm working with PHP , but I imagine this can only be done with javascript/jQuery . When I upload the browser shows the percentage in the status bar. I'd like to take this value and create a custom progress bar from it. The bar I...
asked by 19.12.2013 / 16:42
3
answers

Joining PHP files into one only increases performance?

I have the impression that every time I run the dump-autoload command to generate autoload of classes via composer , a bootstrap/compiled.php file is created. Inside it, there seems to be a tangle of classes and namespaces...
asked by 14.07.2015 / 18:20
4
answers

How to check if an image exists on a remote URL?

In order to be able to administer a website from a server other than the one on which the website is hosted, the problem of dealing with remote images has arisen. Common problems: Verify that the image actually exists before creating link...
asked by 10.01.2014 / 00:17
4
answers

How to create a real-time notification system similar to Stack Overflow?

I am developing a Help Desk system, and would like some ideas on how to create a notification system similar to Stack Overflow itself, whenever any new support is registered. I want to use PHP, MySQL and jQuery only. Should I use window...
asked by 16.03.2014 / 20:21
4
answers

How to decrypt MD5?

If I have the following code $senha = md5("senha") and I send it to the $senha database, it should be possible to retrieve this MD5 in the database and show "password" back on an information update form, / p> Is this possi...
asked by 23.11.2014 / 04:33
5
answers

When to use self vs $ this in PHP?

I see it as a very frequent question: When we should use self:: , or $this in PHP. Which form is most suitable for use and what is the difference between the two situations?     
asked by 18.12.2013 / 12:10
2
answers

What is a loose comparison?

In documentation of PHP, about switch says:    Note : Note that switch / case does loose comparison . What is a loose comparison? And what's the difference between a loose and a rigid comparison?     
asked by 26.06.2017 / 19:15
1
answer

What happens in 1 ... 1 in PHP?

On the web I came across the following code snippet: echo 1...1; Resulting in 10.1 . I made the var_dump of it and the return is: string(4) "10.1" Works with variable assignment: $x = 1...1; echo $x; // 10.1 And for o...
asked by 30.05.2017 / 14:31
2
answers

How to disable a text field for editing using jQuery / JavaScript?

Let's say I have a form with fields from 1 to 7. Something like: field-1 field-2 field-3 field-4 field-5 field-6 field-7 All of these fields are on a form. With Laravel, sometimes I experienced situations when I disabled a field with...
asked by 03.02.2014 / 15:13