you could parse the query string yourself:
PHP Code:
<?php
// mysite.com/display.php?category=php+css
// $QS will hold the query string, as originally written
$QS = $_SERVER['QUERY_STRING'];
// break it into individual key=value chunks
$xQS = strpos( $QS,'&' )? explode( '&',$QS ): array( $QS );
foreach( $xQS as $qs ){
// if there is a key=value pair, break it into an array
if( strpos( $qs,'=' ) ){
$xqs = explode( '=',$qs );
$myGET[ $xqs[0] ] = $xqs[1];
}
// you could also "overwrite" the actual $_GET array if you wanted,
// but I wouldn't.
}
// then use your original idea
if( !empty( $myGET['category'] ) && strpos( $myGET['category'],'+' ) ){
$category = explode( '+',$myGET['category'] );
var_dump( $category );
// prints " array(2) { [0]=> string(3) "php" [1]=> string(3) "css" } "
}
up to you to decide if it's worth the effort, I guess
Bookmarks