Reply to Re: Explode + url faking problem

Your name:

Reply:


Posted by Bent Stigsen on 05/29/06 14:22

frizzle wrote:
[snip]
> $_SERVER['QUERY_STRING'] = '/artists/nirvana/mtv_unplugged'
> $array[0] => artists
> $array[1] => nirvana
> $array[2] => mtv_unplugged
> $array[3] => NULL
[snip]

This one above is your real problem. You would need some mechanism to
determine what kind last element is, file or part of path. A lazy way
could be to set the criteria or just make the assumption that files
always has an attached extension (i.e. '.' in the name).

For instance:
function DefineLoc(){
$loc = explode('/', trim( $_SERVER['QUERY_STRING'], '/' ) );
if (strrpos(end($loc), '.')===false) $loc[] = null;
reset($loc);
return $loc;
};

If you have pathnames containing '.', then you would have to write
some code that can make the distinction.

/Bent

[Back to original 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

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