Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites
//move internal pointer next($colors); //set internal pointer to first element reset($colors); //show which element we're at (re ...
//print out all the values foreach($numbers as $value) { print("$value\n"); } ?> sizeof This is an alias for the count functi ...
<? /* * duplicate normal ordering / function compare($left, $right) { return($left - $right); } //create test data $some_numb ...
{ $data[rand(1,100)] = rand(1,100); } //sort using custom compare uksort($data, "compare"); //show sorted array foreach($data as ...
Hashing is the process of creating an index for a value using the value itself. The index is called a hash. Sometimes hashes are ...
The metaphone algorithm, invented by Lawrence Philips, was first described in Computer Language magazine. You may find a discuss ...
for($i=0; $i <= mhashcount(); $i++) { print("\n"); print("MHASH". mhash_get_hash_name($i). "\n"); print("". mhash_get_block_s ...
string soundex(string text) The soundex function returns an identifier based on how a word sounds when spoken. Similar-sounding ...
For the most part, the string functions create strings from other strings or report about the properties of a string. The except ...
execute eval on a string that contained plain HTML? Probably because the code was stored in a database. Be extremely careful whe ...
string str_repeat(string text, integer count) The str_repeat function returns a string consisting of the text argument repeated ...
Check out soundex, metaphone, and similar_text for alternative ways of comparing strings. <? $first = "abc"; $second = "xyz"; ...
this book."; print("Full text: $text BR>\n"); print("Looking for 'leon':". stristr($text, "leon")); ?> integer strlen(stri ...
print("World is at position ". strpos($text, "World"). "\n"); ?> strrchr This is an alias for strrpos. integer strrpos(string ...
string strstr(string text, string substring) The strstr function returns the portion of the text argument from the first occurre ...
string substr(string text, integer start, integer length) Use the substr function to extract a substring from the text argument. ...
string addslashes(string text) The addslashes function returns the text argument with backslashes preceding characters that have ...
?> string basename(string path) The basename function returns only the filename part of a path. Directories are understood to ...
"\" "); ?> string chr(integer ascii_code) Use chr to get the character for an ASCII code. This function is helpful for situat ...
Sascha Schumann added this function specifically to break base64 codes up into 76- character chunks. Although ereg_replace can m ...
«
8
9
10
11
12
13
14
15
16
17
»
Free download pdf