[PHP] preg_match problem

2002-09-29 Thread Chris N

Ok heres the situation, I have a string like this

$this->_item["title"]  = "28.09.02 - Some silly Text (First) (Second)";

Im trying to do a preg_match on it to check it to make sure its in a certian
format. Heres my preg_match

preg_match("/^(\d+)\.(\d+)\.(\d+)\s+\-\s+(.+)\s+\((.+)\)$",
$this->_item["title"], $matches);
list($all, $one, $two, $three, $four, $five) = $matches;

What Im getting returned in this

$one = 28
$two = 09
$three = 02
$four = Some silly Text
$five = First) (Second

What I want is

$four = Some silly Text (First)
$five = Second

Can anyone see where Im going wrong? The match may be really crude, Im still
pretty new to regular expressions. But it works just fine as long as there
is only one set of ().

Chris N.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] ID variable alsways set

2002-03-03 Thread Chris N

Ive just found a rather weird bug that im experiencing. Im running PHP 4.1.2
with Apache 1.3.23 on Linux Redhat 7. When ever I try and use variable $id
it always has a value of 1 no matter what. It only does it if its in a get,
think a post too. I can hard code it in a script and itll have a correct
value but in a GET it gets messed up. Ive tried running it several ways of
having it be first in the list or last, no matter what its always 1.

Example:
url = http://www.domain.com/test.php?id=12345&name=Kalamazoo

File :
";
echo "id = $id";
echo "click";
?>

Result :
name = Kalamazoo
id = 1
click ( http://www.domain.com/test.php?id=12345&name=Kalamazoo )

Anyone have any ideas what this could come from?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php