|
<?PHP
// FUNCION PRINTFV (PRINT text with Format from a Variable)
// ( similar to PRINTF() )
// Author: Donatien
//
// This function prints out the contents of a varible
// replacing control codes ( " n \ )
// just like printf() does with a string literal.
function printfv($Text)
{
$a = "printf("{$Text}");";
eval($a);
}
?>
|
|
|
Usage Example
|
$text = "This text has "comillas" and a CR right here.n"
printfv($text);
// prints out a parsed string, just like:
printf("This text has "comillas" and a CR right here.n");
// but getting it from a variable instead of a string literal.
// and this is good because if we just run this:
$text = "This text has "comillas" and a CR right here.n"
printf($text);
// control codes will be printed without getting parsed.
|
|
|
Rate This Script
|
|