k i got a problem the code is working but having a problem
if(ereg("<([0-9]*)>.*",$text,$matches)){
if people type <> it responds too it and i wont to exclude that
any ideas?
How does it not work? After all, you may know what your code is intended to do, but the rest of us can only observe what your code actually does.
ok i got a site that u pm someone like this <1> 1 being the persons number PM meaning private message well if you just do this, <> it will send a message to everyone syntax is <1>text here so the if statement should only be true if it comes out liek that
ereg("<([0-9]+)>.*",$text,$matches)
That said, I suggest you use the PCRE regex functions instead, e.g., [man]preg_match/man.
ended up going with
$pattern = "|<([0-9]+)>(.*)|"; if(preg_match($pattern,$text, $matches)){
thx laserlight
That is a better idea; the PCRE functions are more powerful (and have just been upgraded, at that), while the ereg functions are going away in PHP 6.