note 22679 added to function.sprintf
| From: | eden_zero_x at hotmail dot com | Date: | Wed, 26 Jun 2002 18:05:02 +0000 |
| Subject: | note 22679 added to function.sprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32233@lists.php.net to get a copy of this message | ||
Well I came up with this one, extremely simple. instead of writing <span
class="class">hello</a>
you can write: print class('class','hello'); using sprintf
-----------------------------
function class_ ($class, $text=false)
{
return sprintf ("<span class=\"%s\">%s</span>",
$class,
($text ? $text : $class)
);
}
-----------------------------
--
http://www.php.net/manual/en/function.sprintf.php
http://master.php.net/manage/user-notes.php?action=edit+22679
http://master.php.net/manage/user-notes.php?action=delete+22679
http://master.php.net/manage/user-notes.php?action=reject+22679