Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // check if query string is single or array
- $rows = explode("&", $_SERVER['QUERY_STRING']);
- if ( count( $rows ) > 1 )
- echo 'query string contains more than one query string value' ;
- // Get filter from query string
- // 1 parameter only
- $qs = ( isset ( $_GET['filter']) ) ? htmlspecialchars( $_GET["filter"] ) : '' ;
- echo $qs ;
- // echo ( isset ( $_GET['filter']) ) ? htmlspecialchars( $_GET["filter"] ) : '' ;
- // for multiple query string filters
- $queries = array();
- parse_str( $_SERVER['QUERY_STRING'], $queries);
- echo '<pre>' ;
- print_r( $queries ) ;
- echo '</pre>' ;
- exit() ;
Add Comment
Please, Sign In to add comment