You are here: Re: parse_url question « PHP Programming Language « IT news, forums, messages
Re: parse_url question

Posted by Rik on 02/12/07 08:54

On Mon, 12 Feb 2007 09:42:50 +0100, deko <deko@nospam.com> wrote:

>>> $ref =3D http://example.com/?p=3D32
>>> $ref_a =3D parse_url($ref);
>>> echo ref_a['path']; //returns nothing
>
>> There are two syntax errors in your code:
>>
>> 1. $ref =3D http://example.com/?p=3D32 - you need quotes around this.=

>> 2. echo ref_a['path'] - you did not precede the variable name with $
>>
>> Once you fix those, the path element has a value of "/".
>
> Yeah, that was a sloppy post.
>
> But even after making your suggested corrections, the code is not =

> returning '/?p=3D32', but rather '/', as you pointed out. So I guess =
=

> parse_url() does not work when the url path contains a query string.

Please read the manual when having questions about a specific function. =
=

The query string is a separate part of the url...

http://www.php.net/parse_url

-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация