note 83863 added to function.vprintf
| From: | takenfrom" | Date: | Mon, 16 Jun 2008 05:55:32 +0000 |
| Subject: | note 83863 added to function.vprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140488@lists.php.net to get a copy of this message | ||
<?php
$string = 'The site runs on PHP '.phpversion();
preg_match('/php ((\d)\.\d\.\d+)/i',$string,$matches);
print_r($matches);
vprintf('Match: %s<br /> Version %s; Major:%d.',$matches);
?>
output:
Array ( [0] => PHP 5.2.5 [1] => 5.2.5 [2] => 5 )
Match: PHP 5.2.5 Version 5.2.5; Major:5.
For preg_match:
If matches is provided, then it is filled with the results of search. $matches[0] will contain the
text that matched the full pattern, $matches[1] will have the text that matched the first captured
parenthesized subpattern, and so on.
----
Server IP: 69.147.83.197
Probable Submitter: 71.202.103.225
----
Manual Page -- http://www.php.net/manual/en/function.vprintf.php
Edit -- https://master.php.net/note/edit/83863
Del: integrated -- https://master.php.net/note/delete/83863/integrated
Del: useless -- https://master.php.net/note/delete/83863/useless
Del: bad code -- https://master.php.net/note/delete/83863/bad+code
Del: spam -- https://master.php.net/note/delete/83863/spam
Del: non-english -- https://master.php.net/note/delete/83863/non-english
Del: in docs -- https://master.php.net/note/delete/83863/in+docs
Del: other reasons-- https://master.php.net/note/delete/83863
Reject -- https://master.php.net/note/reject/83863
Search -- https://master.php.net/manage/user-notes.php