ereg won't work !

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Worrel
Forum Newbie
Posts: 2
Joined: Thu Jun 13, 2002 5:41 am

ereg won't work !

Post by Worrel »

The following ereg function won't produce anything. My browser keeps waiting for data for more than 15 minutes ...
If I take "this is a testtext" as $text then it finishes in about a sec, so what's wrong ?

Code: Select all

$text = "testtext ";
$regex = "їa]";
$n = ereg($regex, $text);
echo ($n);
rya,
Worrel
Worrel
Forum Newbie
Posts: 2
Joined: Thu Jun 13, 2002 5:41 am

Post by Worrel »

D'uh !
last line should read:

Code: Select all

if ($n) {
  echo ($n);
} else {
  echo "not found";
}
but thx for reading anyway,
Worrel
Post Reply