I have a url as below.... http://www.domain.com/keyword-abc/xyz.html I want to use keyword as variable. I have searched a lot to get it done but found nothing. any help?
This script has to work for your domain: preg_match('/(?P<keyword>\w+)-/', $_SERVER["REQUEST_URI"], $matches); $keyword = $matches["keyword"]; echo($keyword); Code (markup):
I may be wrong. So may its code can help you? <html> <body> <?php $d=date("D"); if ($d=="Mon") echo " Get ready for the week!"; else echo "Have a good day!"; ?> </body> </html> If I am wrong you can search at this web site: php tutorials.