Jump to content

[SOLVED] Breaking down a string.


Lamez

Recommended Posts

How do I break down a string?

 

I have a External Link Checker(http://links.krazypicks.com), which will check to see if the URL is in the blacklist that is in the database, but if it is not then it will show a continue warning. Well I want to know how to break down the URL. say they type this in:

 

 

I want to break it down to www.youtube.com, to check, then display the real URL.

 

Does this make sense?  You can just give me a function.

 

-Thanks :D

 

Link to comment
https://forums.phpfreaks.com/topic/127642-solved-breaking-down-a-string/
Share on other sites

ok so I have this bit:

 

<?php
$link = print_r(parse_url($url));
?>

 

but it is echoing out, and I know it is in an array, but how to I take it out?

 

here is an example of the out put:

 

Array ( [scheme] => http [host] => www.youtube.com [path] => /watch [query] => v=Cqsrq34qDyk )

 

how can I just echo out the host?

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.