Basic example how to read an XMLdata

<?php     $xmlBody = "<?xml version='1.0' encoding='UTF-8'?>     <locations>         <city1>...

Example of XML DOM in PHP

// XML file     $xmlBody = "<?xml version='1.0' encoding='UTF-8'?>     <locations>         <city1&...

Another example of XML DOM in PHP

// XML file     $xmlBody = "<?xml version='1.0' encoding='UTF-8'?>     <locations>         <city1&...

Example of PHP session

// starting a session <?php     session_start(); ?>          // HTML <!DOCTYPE html> <html>...

Example of setting PHP cookie

<?php     $cookie_var = "username";     $cookie_val = "admin";     setcookie($cookie_var, $cookie_val, time()+(86400*10),...

Example of deleting PHP cookie

<?php     $cookie_var = "username";     $cookie_val = "admin";     setcookie($cookie_var, $cookie_val, time() - 3600); //...

Example of checking PHP cookie if enabled

<?php     $cookie_var = "username";     $cookie_val = "admin";     setcookie($cookie_var, $cookie_val, time() + 3600); //...

Example of error handling for missing files in PHP

<?php     if(!file_exists("path/file.php"))     {         die("File does not exist!");     }

Example of detecting undefined variable

<?php     function customError($errorno, $errorstr)      {         echo "Error: [$errorno] $errorstr";  ...

Example of $_POST form submission with letter, number, email and URL filters

<?php     // variables preset     $nameval = $ageval = $emailval = $urlval = "";     $name = $age = $email = $url = "";