Extract is your friend

Use of extract function, For example, generally how we use varibles. $name = $_REQUEST[‘name’]; $surname = $_REQUEST[‘surname’]; $message = $_REQUEST[‘message’]; So, instead of defining as above , we can use extract($_REQUEST); Will automatically make $name = $_REQUEST[‘name’]; So, you can say “hello “.$name.” “.$surname.” without doing all the declarations.Read more …

Rewrite rule with ‘question mark (?)’

For using ‘question mark ‘ in rewrite rule first, we have to apply RewriteCond ¬†with %{QUERY_STRING}. because we can’t use ‘question mark’ directly in Rewriterule. Try with below code http://www.example.com/products/title1/title2/?id=5 So, to create above URL, we can use below code #RewriteCond %{QUERY_STRING} ^id=(.*)$ #RewriteRule ^products/(.*)/(.*)/?$ products.php?ac=viewProduct&id=%1&cid=0 [L]Read more …