note 74995 added to function.fprintf
| From: | phyrox at hotmail dot it | Date: | Mon, 07 May 2007 22:23:18 +0000 |
| Subject: | note 74995 added to function.fprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126307@lists.php.net to get a copy of this message | ||
PHP 4 doesn't support this function, but if you want to use fprintf function or if you have a
script wrote for php 5 you can use this function:
<?php
if ( !function_exists('fprintf') ) {
function fprintf( $file, $str ) {
$argn = func_num_args();
$i = strpos( $str, "%" ) + 2;
$k = 2;
while( $k < $argn && $i != false ) {
$arg = func_get_arg( $k );
$str = sprintf( substr( $str , 0 , $i ) , $arg ) . substr( $str, $i );
$k = $k + 1;
$i = strpos( $str, "%" ) + 2;
}
if( $file != false ) {
return fputs( $file, $str, strlen( $str ) );
} else return false;
}
}
?>
----
Server IP: 213.92.11.19
Probable Submitter: 151.73.91.161
----
Manual Page -- http://www.php.net/manual/en/function.fprintf.php
Edit -- https://master.php.net/note/edit/74995
Del: integrated -- https://master.php.net/note/delete/74995/integrated
Del: useless -- https://master.php.net/note/delete/74995/useless
Del: bad code -- https://master.php.net/note/delete/74995/bad+code
Del: spam -- https://master.php.net/note/delete/74995/spam
Del: non-english -- https://master.php.net/note/delete/74995/non-english
Del: in docs -- https://master.php.net/note/delete/74995/in+docs
Del: other reasons-- https://master.php.net/note/delete/74995
Reject -- https://master.php.net/note/reject/74995
Search -- https://master.php.net/manage/user-notes.php