Some PHP functions and code snippets useful for PHP Programmers and scripts.
New PHP Code Snippets might be added soon.

  1. Get Time Elapsed
  2. Interpret / Parse / Replace variable in string with value
  3. Delete multiple consecutive characters and Split long words
  4. Force Download files with PHP
  5. innerHTML in PHP
  6. Keep the first Nr IMG tags, Strip all the others
  7. Convert XML to JSON in PHP
  8. Get the Timestamp of First and Last day of Month
  9. Create Array of Unique Random Numbers or Letters
  10. Image in PHP with background in two colors
  11. Sort an entire multi-dimensional Array
  12. Merge Multiple Files, Line by Line
  13. Dynamically PHP Maps with Rectangle, Parallelogram, and Rhomb Shapes
  14. Chaining Static and Public Methods in PHP
  15. Recursive function to create Multi-Level Menu in PHP
  16. XML sitemap with data from MySQL
  17. Split an alphanumeric string into Array in PHP
  18. Save image on server from external URL
  19. Get visitor IP in PHP
  20. PHP Image with text on New Lines
  21. Get all the unique numbers from two-dimensional array
  22. Get Closest Number
  23. Get Lower, Higher, and Closest Number
  24. Create ZIP file archive with PHP
  25. Extract / Unzip ZIP archive files with PHP
  26. Read ZIP archive data with PHP
  27. Get the difference between two Dates - Time and Date
  28. Calculate the Age in PHP
  29. Zodiac Signs PHP code

Daily Test with Code Example

Which tag can be used to create input text field in web page?
<form> <input> <div>
<input type="text" name="a_name" value="val" />
Which CSS property displays the text in a small-caps font?
display font-variant font-style
h3 {
  font-variant: small-caps;
What instruction displays a notice box with a message inside it, in JavaScript?
for() Date() alert()
var msg = "Visit";
Indicate the PHP code used to get the users IP.
echo $ip;
PHP Code Snippets

Last accessed pages

  1. Read Excel file data in PHP - PhpExcelReader (677)
  2. Validate radio and checkbox buttons (144)
  3. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (1412)
  4. Get the difference between two Dates - Time and Date (45)
  5. Convert XML to JSON in JavaScript (413)

Top accessed pages

  1. PHP-MySQL free course, online tutorials PHP MySQL code (1490)
  2. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (1472)
  3. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (1412)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (1126)
  5. PHP Chat Script (1073)