You are here: Re: break up a string « All PHP « IT news, forums, messages
Re: break up a string

Posted by ZeldorBlat on 08/12/05 17:26

If that was indeed the request URL then Michael's solution is the way
to go. If you're getting that string from somewhere else, you could
try something like this:

//$query contains everything after the ? :
$query = substr($refering_str, strrpos($refering_str, '?')+1);

$vars = parse_str($query); //$vars is an associative array of the
variables
$q = $vars['q'];

This will work even when the query string has many variables that are
in some random order.

 

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

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