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

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to include external CSS file in web page?
<body> <script> <link>
<link href="/templ/style.css" rel="stylesheet" type="text/css" />
Which CSS property sets the text size?
font-weight text-decoration font-size
h2 {
  font-size: 1em;
}
Indicate the JavaScript property that can add HTML code into an element.
text value innerHTML
document.getElementById("someID").innerHTML = "HTML content";
Click on the function that returns the number of characters of a string in PHP.
count() strlen() stristr()
$str = "http://CoursesWeb.net/";
$nr_chr = strlen($str);
echo $nr_chr;       // 22
PHP Code Snippets

Last accessed pages

  1. jQuery background position (1354)
  2. Java Programming Courses and Tutorials (850)
  3. Select in two MySQL tables (2558)
  4. Creating objects in ActionScript (3210)
  5. PHP getElementById and getElementsByTagName (7331)

Top accessed pages

  1. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (26987)
  2. PHP-MySQL free course, online tutorials PHP MySQL code (22674)
  3. Get Attribute (ID, Class, Name, Title, Src) with jQuery (22176)
  4. Read Excel file data in PHP - PhpExcelReader (19860)
  5. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (19199)