Skip to content
Software
Blog
About
Contact
Search
Menu
Software
Blog
About
Contact
Search
Search
How can I use the array_unshift function to add an element to the beginning of an array in PHP? Example code:
Listen
$fruits = array("apple", "banana", "orange"); array_unshift($fruits, "grape"); print_r($fruits);
How can I add days to a date in PHP? Example code:
How can I sort an associative array by its keys in PHP? Example code:
How can I use the array_diff function to get the elements in one array that are not in another array in PHP? Example code:
How can I generate a random number in PHP? Example code
How can I trim whitespace from the beginning and end of a string in PHP? Example code:
How can I use the is_writable function to check if a file is writable in PHP? Example code:
How can I subtract days from a date in PHP? Example code:
How can I use the array_reverse function to reverse the order of an array in PHP? Example code:
How can I format a date in PHP? Example code:
How can I use the strrev function to reverse a string in PHP? Example code:
How can I use a ternary operator in PHP? Example code:
How can I use a regular expression to replace a pattern in a string in PHP? Example code:
How can I use the explode function to split a string into an array in PHP? Example code:
How can I use a do-while loop in PHP? Example code:
How can I use the curl_exec function to execute a cURL session and get the response in PHP? Example code:
How can I use the array_merge function to merge two or more arrays in PHP? Example code:
How can I use the array_rand function to get a random key from an array in PHP? Example code:
How can I sort an array in PHP? Example code:
How can I create a session variable in PHP? Example code
How can I use the curl_setopt function to set options for a cURL session in PHP? Example code:
How can I use the in_array function to check if an element exists in an array in PHP? Example code:
How can I use the json_decode function to convert a JSON string to an array or object in PHP? Example code:
How can I sort an array in PHP? Example code:
How can I use the array_search function to search for a value in an array and return its key in PHP? Example code:
How can I use a regular expression to match a pattern in a string in PHP? Example code:
How can I use a try-catch block in PHP? Example code:
How can I format a number with commas in PHP? Example code:
How can I create a class in PHP? Example code:
Get User IP Address using PHP – Source Code + Demo
PHP Use Cases with Example Source Code