Anonymous functions as properties in Classes in PHP
When using anonymous functions as properties in Classes, note that there are three name scopes: one for constants, one for properties and one for methods. That means, you can use t
Read tutorialTHE TUTORIAL LIBRARY
When using anonymous functions as properties in Classes, note that there are three name scopes: one for constants, one for properties and one for methods. That means, you can use t
Read tutorialMake an array of two entries where the 0th entry is the name of the class to be invoked ('self' and 'parent' work as well) and the 1st entry is the name of the function. Basically,
Read tutorialA function can only return one value, but that value can be an array or other compound value. If you want to just define several variables into the global scope within your functio
Read tutorialIf you compiled with "--enable-track-vars" then an easy way to get variable function args is to use extract()
Read tutorialYou may pass any number of extra parameters to a function, regardless of the prototyping. In addition, the arguments passed to a function will be available via the variable names d
Read tutorialTo use a PHP class within a function, you need first to load class OUT of the function and then you can use the class functions from your function.
Read tutorialIf you define function within another function, it can be accessed directly, but after calling parent function.
Read tutorialAnother useful function to find the first and last day of the month from the given date in PHP
Read tutorialHere is an useful code snippet that calculates the next working day in the US. This takes into account the US Federal holiday as well.
Read tutorialI found this little function very useful in fixing strings that are not in utf-8 but need be converted
Read tutorialI think this is a reasonable port of Perl's Encoding::FixLatin by Grant McLean, which converts a string with mixed encodings (ASCII, ISO-8859-1, CP1252, and UTF-8) to UTF-8.
Read tutorialI've been working on a is_utf8 function and wanted to post it here, in addition to others i also took in consideration the 5000 char bug:
Read tutorialOne example today. A better developer tomorrow.