Questions tagged as 'php'

1
answer

What is the purpose of the "use" command and what is its relation to anonymous functions?

I'm doing tests with a RESTFul API that I'm creating using the Slim micro-framework, and in one of those routines that is responsible for executing a particular action, I was struck by a command I did not know, which is the command use ....
asked by 18.12.2016 / 01:40
3
answers

Which regular expression can I use to remove double spaces in Javascript or PHP? [duplicate]

Which regular expression can I use to remove excess white space? I mean, leave them with the amount of standard spaces. Example From: $string = 'Estou no Stack Overflow em Português '; To: $string = 'Estou no Stack Overflow...
asked by 21.08.2015 / 18:14
4
answers

I need to block ctrl + v in a text box

I want to create an input type="text" that does not allow anything to be pasted into it. You do not need to have any alert or anything, just do not allow the paste.     
asked by 27.02.2014 / 01:58
4
answers

What is the difference between "notice" and "warning" in PHP?

I always see programmers saying, "Ah, if you do, you'll get a notice , but if you do, you get a warning ", so I got the debt: What's the difference between them?     
asked by 23.02.2017 / 20:58
4
answers

How to find hashtags in a string and store them in an array?

I have a system for posting content on a certain social network of our company. When the user enters text with hashtags , I need to detect all of them and store them in an array. Example:    Hello, I'm posting this # question to #...
asked by 19.10.2015 / 17:47
1
answer

How to check if the message was delivered, websocket php

How can I check if a message that is sent by the WEBSOCKETS Server has been delivered to the endpoint? Use this class: link     
asked by 10.03.2015 / 00:00
2
answers

Routes Laravel 5.3

Good afternoon people, I noticed that Laravel 5.3 has a new folder "Route", with the routes. By default it uses web.php I would like to know how I can do to create other routes without being inside the web.php, I would like to separate it lik...
asked by 22.09.2016 / 20:33
2
answers

Undefined index: PATH_INFO

I would like to retrieve the URL using $_SERVER['PATH_INFO'] and had a nice surprise:    Undefined index: PATH_INFO On the contrary, using $_SERVER['REQUEST_URI'] everything works perfectly. What should be the source of t...
asked by 31.12.2016 / 21:27
2
answers

Upload image by selecting it and showing thumbnail without refresh on page

How do I make a code to send an image when I select it during registration? And after sending a thumbnail appears on the form, then the user will continue filling in the rest of the form. Similar to what is done in this link .     
asked by 13.02.2014 / 10:49
3
answers

Sending data to the same form is a good method?

I have a login form which, after given submit it is sent to itself with the information via POST , and if it is wrong, it displays an error message and shows the same form again. I did this to avoid creating type pages: login.php...
asked by 28.02.2014 / 19:18