Deprecated: Function ereg() is deprecated in php5.3
Posted: Wed Sep 02, 2009 10:37 pm
hi , Iam new in php, i run the test program
the output is Deprecated: Function ereg() is deprecated in C:\wamp\www\Expressions\ereg.php on line 7
http://www.apress.com
http://www
apress
com
what is wrong??
Code: Select all
<?php
$url = "http://www.apress.com";
// break $url down into three distinct pieces:
// "http://www", "apress", and "com"
$parts = ereg("^(http://www)\.([[:alnum:]]+)\.([[:alnum:]]+)", $url, $regs);
echo $regs[0]; // outputs the entire string "http://www.apress.com"
echo "<br>";
echo $regs[1]; // outputs "http://www"
echo "<br>";
echo $regs[2]; // outputs "apress"
echo "<br>";
echo $regs[3]; // outputs "com"
?>http://www.apress.com
http://www
apress
com
what is wrong??