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

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

Daily Test with Code Example

What attribute makes the input text box to not be modified by the user?
checked="checked" readonly="readonly" disabled="disabled"
<input type="text" value="fixed-value" readonly="readonly" name="a_name" />
What CSS property allows you to create rounded corners in your webpage design?
background-size border-size border-radius
.class {
  border:2px solid blue;
What instruction displays a confirmation dialog box to the viewer, who must then click OK or Cancel to proceed?
indexOf() confirm() prompt()
var ques = window.confirm("The result of 0+0 is 0?");
if (ques) alert("Corect");
else alert("Incorrect");
Indicate the PHP function that returns the lowest number of the parameter values.
floor() ceil() min()
$min_nr = min(12, 8, 25, 13);
echo $min_nr;        // 8
PHP Code Snippets

Last accessed pages

  1. PHP MySQL - INSERT INTO (1702)
  2. Ajax Voting Script - Vote Up Down (968)
  3. Download PHP MySQL resources (1373)
  4. JavaScript Chronometer / Stopwatch (596)
  5. Adding text with ActionScript 3 (555)

Top accessed pages

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