Hi All,
I've written a inifile class and was trying to improve it but got stuck
trying to read all the sections:
[Section 1]
name=value
[Section 2]
name=value
$Inifile is the inifile read into an array but the following doesn't work:
$Sections = preg_grep(/(?=^\[)([^\[\]]+)(?=\]$)/i,
Hello all,
I have a file that has ip address in it.. I need to pull those ip addresses
out.
Currently I am trying:
$ips=preg_grep(/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/,$file);
print_r(array_values ($ips));
And well i am getting nothing!
Anyone?
--
PHP General Mailing List
Does anyone see a need for a limit parameter to preg_grep() that would
limit the number of array entries returned?
-Andrei
* My wishlist: http://www.amazon.com/exec/obidos/wishlist/2Q2DIPY7BZLSH/ *
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
-Original Message-
From: Andrei Zmievski [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 18, 2001 12:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] preg_grep() and limit parameter
Does anyone see a need for a limit parameter to preg_grep() that would
limit the number of array entries returned?
-Andrei
It does not appear to be in the documentation yet (and only a little
blurb in the NEWS file)
but preg_grep has changed.
Assume $file_list is an array of file names using integer keys, e.g.,
$file_list { 0 = test, 1 = filenames }
$result = preg_grep(/name/i, $file_list);
Here is an example of
5 matches
Mail list logo