PHP arrays are especially flexible. They can be indexed or associative, and they can be nested.
|One german tutorial about using PHP arrays is www.php-einfach.de/php-tutorial/php-array.php/ .||Tutorial|
|The official manual page about arrays http://php.net/manual/en/language.types.array.php .||Manual|
Problem: We have two strings and want know, up to which position they are identical.
|A cool solution is found on Stackoverflow in tread "Find first character that is different between two strings", in the posting by ircmaxell on 2011-September-19. He says: "... when you xor two strings, the characters that are the same will become null bytes (chr(0)) ...". . BTW ircmaxell writes nice PHP articles in his blog blog.ircmaxell.com .||Thread|
E.g. in editpointstatic/esp.index.php in function 20110923°0721 it looks like this:
$s1 = $_SERVER['HTTP_REFERER']; // "http://localhost/eps/testpage.html"; $s2 = $_SERVER['SCRIPT_URI'] // "http://localhost/eps/eps/index.php"; $sXor = $s1 ^ $s2; $iPos = strspn($sXor, chr(0)); $sTail1 = substr($s1, $iPos); // = "testpage.html" $sTail2 = substr($s2, $iPos); // = "eps/index.php"
There are several ways to send a HTTP request, depending on the actual needs. Following are some examples (see also Stackoverflow link below). More sophisticated flavours are possible, e.g. for using a proxy or setting authentication.
// just get the file content $xml = file_get_contents("http://www.example.com/file.xml");
// have detailed control about the request and // have the ability to view the http response header $response = http_get("http://www.example.com/file.xml");
// use the curl library $ch = curl_init("REMOTE XML FILE"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, 0); $data = curl_exec($ch); curl_close($ch);
|Stackoverflow thread How to send a GET request from PHP? is enumerating some methods to do the job .||Thread|
Since version 5, PHP is fully object oriented. More precisely: you can use classes, but need not.
|The official manual page about object oriented programming in PHP: http://php.net/manual/en/language.oop5.php .||Manual|
Jörg Krause: Kochbuch PHP5, (c) 2005 Carl Hanser Verlag München Wien, ISBN 3-446-22736-9, 508 pages, www.hanser.de/computer . Some interesting demo files from this book are:
Imprint : www.trilo.de