Top "Php" questions

PHP(Hypertext Preprocessor) is a widely used, high-level, dynamic, object-oriented, and interpreted scripting language primarily designed for server-side web development.

How do I check if a string contains a specific word?

Consider: $a = 'How are you?'; if ($a contains 'are') echo 'true'; Suppose I have the code above, what is …

php string substring contains string-matching
Get the full URL in PHP

I use this code to get the full URL: $actual_link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; The …

php url
How do I get PHP errors to display?

I have checked my PHP ini file (php.ini) and display_errors is set and also error reporting is E_…

php error-handling syntax-error error-reporting
How do I make a redirect in PHP?

Is it possible to redirect a user to a different page through the use of PHP? Say the user goes …

php redirect
Deleting an element from an array in PHP

Is there an easy way to delete an element from an array using PHP, such that foreach ($array) no longer …

php arrays unset
How do I get the current date and time in PHP?

Which PHP function can return the current date/time?

php datetime
How do I convert a string to a number in PHP?

I want to convert these types of values, '3', '2.34', '0.234343', etc. to a number. In JavaScript …

php casting type-conversion
"Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset" using PHP

I'm running a PHP script and continue to receive errors like: Notice: Undefined variable: my_variable_name in C:\wamp\…

php arrays variables warnings undefined-index
How can I prevent SQL injection in PHP?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like …

php mysql sql security sql-injection
Convert a date format in PHP

I am trying to convert a date from yyyy-mm-dd to dd-mm-yyyy (but not in SQL); however I don't know how …

php date formatting