Jump to content

getting domain from url


xwishmasterx

Recommended Posts

I am tring to get the domain from a url inside a while loop. Currently my code looks like this:

 

...while($row = mysql_fetch_array( $result )){

?><img src="<?php echo "".$row['te_link']."";?>.....

 

If $row['te_link'] returns "http://domain.com/images/..." I need it to just return http://domain.com".

I've tried various functions to strip the unwanted stuff, but nothing working correct.

 

Anyone can help me out?

Link to comment
https://forums.phpfreaks.com/topic/263215-getting-domain-from-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.