I want to return JSON from a PHP script. Do I just echo the result? Do I have to set the Content-Type header?
I have a PHP array as follows: $messages = [312, 401, 1599, 3, ...]; I want to delete the element containin
How can I detect which request type was used (GET, POST, PUT or DELETE) in PHP?
I have tried reading some articles, but I am not very clear on the concepts yet. Would someone like to take a
I have an array: array( 4 => 'apple', 7 => 'orange', 13 => 'plum' )
Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS att
What is this? This is a number of answers about warnings, errors, and notices you might encounter while progra
It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which
I know that PHP doesn't yet have native Enumerations. But I have become accustomed to them from the Java
How can I sort this array by the value of the "order" key? Even though the values are currently sequential, th
I'm running a PHP script and continue to receive errors like: Notice: Undefined variable: my_variable_na
How can I get the client IP address using PHP? I want to keep record of the user who logged into my website t
Every now and then I hear the advice "Use bcrypt for storing passwords in PHP, bcrypt rules". But what is bcr
In PHP: When should I use require vs. include? When should I use require_once vs. include_once?
Is it possible to redirect a user to a different page through the use of PHP? Say the user goes to www.exampl
How can I write two functions that would take a string and return if it starts with the specified character/st
I have checked my PHP ini file (php.ini) and display_errors is set and also error reporting is E_ALL. I have r
Let me prefix this by saying that I know what foreach is, does and how to use it. This question concerns how i
How can one parse HTML/XML and extract information from it?