Re: parse_url not parsing hosts with www properly in php 5.1.2
| From: | Jochem Maas | Date: | Thu, 23 Feb 2006 10:49:19 +0000 |
| Subject: | Re: parse_url not parsing hosts with www properly in php 5.1.2 | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230946@lists.php.net to get a copy of this message | ||
Dan Rossi wrote:
On 23/02/2006, at 8:45 PM, Jochem Maas wrote:I understand what exploding means in the context of php, what I didn't understand was that you started to go about exploding urls in a follow on post without any clarification (in the previous post there was no mention of the processing being done to the _url_ let alone that your dealing with a whole list of urls) obviously you didn't get the point about not forcing other people to infer whatever it is you are doing [prior to where your code 'breaks'] when you want them to help you fix your code.Dan Rossi wrote:PHP slang == explode()Ok it looks like when i exploded the urls by a comma, one has spaceexploding the urls??? - this list is not called 'php-psychics' for a reason. i.e. don't assume we know that you happen to have a string which contains 'urls' that you seem to explode on a comma before going on to run parse_url() on each item in the ensuing array. ;-)
here is another example of what I mean: in the string "__http" you _seem_ (that what I infer but I don't for sure) assume that everyone implicitly understands that where yuou place an underscore should be read as a blank space.padding, i had to trim it first, the array was coming out like host=>__http path=>//www.thedomain.com :\
do you see the difference between the following 2 statements?: 1. 'one has space padding' 2. 'it had a space before the http://' and with regard to the remark "The previous part was from the var_dump" that is just not true as the following code demonstrates (unless you happen to have a php install with a serverly borked var_dump() function): $r = array( "host" => "__http", "path" => "//www.thedomain.com" ); var_dump($r); this outputs (notice how the output is nothing like the string "host=>__http path=>//www.thedomain.com" that you posted originally): array(2) { ["host"]=> string(6) "__http" ["path"]=> string(19) "//www.thedomain.com" } http://www.google.com/search?num=100&q=define%3Averbatimthat 'array' is clear as mud. next time maybe post some code and show (copy+paste) the actual output not some handtyped approximation. And before doing even that I recommend you always do some simple debugging with var_dump() to examine the actual contents of the variables in the code that seems to be broken (once you see what in a variable it is quite often obvious what is going wrong).The previous part was from the var_dump ,as explained the url needed