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

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

Daily Test with Code Example

Which tag renders as emphasized text, displaying the text oblique?
<strong> <pre> <em>
<p>Web development courses: <em></em></p>
Which CSS property defines the space between the element border and its content?
margin padding position
h3 {
  padding: 2px 0.2em;
Click on the method which returns the first element that matches a specified group of selectors.
getElementsByName() querySelector() querySelectorAll()
// gets first Div with class="cls", and shows its content
var elm = document.querySelector("div.cls");
Indicate the PHP variable that contains data from a form sent with method="post".
if(isset($_POST["field"])) {
  echo $_POST["field"];
PHP Code Snippets

Last accessed pages

  1. Pool (246)
  2. Insert, Select and Update NULL value in MySQL (10511)
  3. jQuery Drag and Drop Rows between two similar Tables (4395)
  4. PHP OOP - Abstract classes (1851)
  5. SimpleModal Dialog Windows (1074)

Top accessed pages

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