PHP question about parse_url

Reply Sat 5 Jun, 2010 03:24 pm
I have a site that is using parse_url in this command:
<?php $domain = parse_url($row['buyfrom'], PHP_URL_HOST); ?>
buyfrom is a url and in this case the specific url I having difficulty with is very long:


I'm getting all kinds of errors. Is there a way to fix this command so that it can handle the long url like this one? I'm assuming the length of the URL is the issue.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 2,988 • Replies: 1
No top replies

Reply Sat 5 Jun, 2010 04:42 pm
Apparently, this line of code serves to extract the URL's domain. So why not precede it with a line that cuts off the URL after the top-level domain(".com" in this case), pass the so-tuncated url to to parse_url(), and see if the error messages go away?
0 Replies

Related Topics

\n - Question by negikaithal
What does \n mean in PHP Code? - Discussion by roverroad
PHP Debate - Discussion by Craven de Kere
PHP: Cookie Problem - Discussion by BobbyDouglas
Installing PHP with IIS - CGI Error - Discussion by skinnz
Displaying <?php in javascript. - Discussion by BobbyDouglas
php software - Question by aishna
  1. Forums
  2. » PHP question about parse_url
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/28/2024 at 10:35:55