PhpSnip.com

User Stats

FUNCION PRINTFV (PRINT text with Format from a Variable)

This function prints out the contents of a varible replacing control codes ( \" \n \\ ) just like printf() does with a string literal.

Info

 Download  View Source (print view)
 Rating : 4.7  Views : 304

Source Code ( 20 lines )

<?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);

}

?>

Search

Subscribe

  Rss Feeds

Sponsors

Advertise