With object orientated languages came the concept of the try-catch block to better manage exceptions and application crashes, and from PHP 5 onwards, the popular web server-side scripting language too adopted this ideology.
Daily Archives: January 6, 2012
Translate characters or replace substrings
Is there any function which replaces params in a string? Something like this:? Code: $format_str = "My name is %name."; /* this was set in a configuration file – config.php */$str = xprintf($format_str, array(\’name\’ => \’Joe\’, \’age\’ => 150)); /* above is somewhere in main code */ The expected value of $str after …
Continue reading “Translate characters or replace substrings”