View Single Post
Old 04-21-2005, 09:51 AM   #6 (permalink)
crash
The Wanderer
 
Join Date: Apr 2005
Posts: 6
Thanks: 0
crash is on a distinguished road
Default

I started learning PHP 3 days ago. Honestly, its really simple and im almost done because I already know C/C++ and am familiar with UNIX and stuff.

Sometimes, stuff slips my mind though so maybe... a PHP Cheat Sheat . Should include syntax, explanation, example, output (if applicable)
Example :
strtr (intial string, string from, string to) // Returns a string by translating every occurance of a charachter in 'string from' to the charachter in 'string to' with the same position.
Code:
$string = '<P>"This Sucks" Jane Fumed</P>';
$encoded = htmlspecialchars(addslashes($astring));
$decode_table = get_html_translation_table(HTML_SPECIALCHARS);
echo strtr(stripslashes($encoded), array_flip($decode_table));
"This Sucks" Jane Fumed

Please Note : In the cheat sheet, unless if its an advanced function i seriously would suggest that you dont use semi-advanced uses of it as i did in my example . Also I wouldnt suggest that you use functions other than the ones the example is describing .
crash is offline  
Reply With Quote