Archive for February, 2009
PHPClasses
Open source resource for object oriented PHP code. Community based. Upload and share your creations.
Monthly voting for the “Programming Innovation” award where authors could win valuable prizes.
array_keys()
Returns an array whose values are the keys of the input array. Optionally, search for a value in the input array and return only those keys with corresponding values.
array_values()
Converts an array into a numerically indexed array (starting at zero). The original array is left untouched (a new array is returned). Nested arrays are not re-indexed.
The Optional Closing Tag
Should the closing PHP tag ?> be used at the end of a PHP file? This question was posed to the PHP community. There are arguments both for and against putting it in. See the poll results…
parse_str()
Parses a string as if it were a query string. Puts the variables into the current scope [like extract()], or into an array named as the second parameter.
http_build_query()
Generates a URL-encoded query string from an array. You can optionally supply a prefix for numeric keys of the array, as well as the argument separator which is typically “&” for most setups.
Planet PHP
“All news in one place” as their tag line says. This site grabs a bunch of feeds from PHP related sites and delivers them to you. Keep up with PHP news from around the world at planet-php.org
str_pad()
Pad a string to a certain length with spaces, or another string you specify. By default, it adds characters to the right only, but it could be made to pad the left only, or both sides.
md5_file()
Works the same as md5() but instead of a string as input, this function takes a file name and returns the hash of the file using the MD5 algorithm.
The result here too will be a string 32 characters long. Setting the second parameter, raw_output, to true will instead return the raw binary format of the string with a length of 16.
md5()
When given a string, it generates a hash string using the MD5 algorithm. The result will be a string 32 characters long. Setting the second parameter, raw_output, to true will instead return the raw binary format of the string with a length of 16.
