954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

php url regex

hey there this problem stuck me out

how to display url like this

http://www19.domain.com/548ecedd7f87970e986dc19077ef2edd.rar
preg_match_all('#^(?:http://)www[0-99]([^/]+)#i',$url,$parts);
foreach ($parts[1] as $test)
{
  echo 'hehehe '. $test;
}


and the result is:

hehehe 9.domain.com


it just stuck me out

i'm already search the answer at least 5 hours :(

i do not want to parse another url because i can get it, but this problem stuck me out :(

murray_ramadhan
Newbie Poster
2 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 
preg_match_all('#^(http://.*www+[0-99][0-99]\.[a-z-0-9]+\.[a-z]+/+[a-z-0-99-A-Z]+\.[a-z-0-99-A-Z]+)#i',$url,$parts);
foreach ($parts[1] as $test)
{
  echo $test;
}


solved! :D thanks!

murray_ramadhan
Newbie Poster
2 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You