|
Posted by paladin.rithe@gmail.com on 06/05/07 20:38
This is probably simple, but I want to pull out data (not count) from
a string, and the preg_grep looked like the best option. I'm pulling
an entry out of the database (which is a text field), a sample being:
Note #13 for Task #23 added to the system. I want to pull the 13, and
the 23 out. (probably need 2 different calls, but that's ok).
The problem that I'm having though is this: Warning: preg_grep()
expects parameter 2 to be array, string given in table.php on line 18
Here is the code for that line: $note = preg_grep("/^Note #([0-9]+)/",
$text);
$text is the value of $row['text'] (tried $row['text'] first, but had
the same thing).
Now, I thought that something of type text would be a string/array, so
why doesn't it like it? I'm running PHP 5.2.1 right now, if that
helps any.
Navigation:
[Reply to this message]
|