Re: Re: Rewriting string
| From: | Nathan Rixham | Date: | Thu, 13 Jan 2011 20:31:19 +0000 |
| Subject: | Re: Re: Rewriting string | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310743@lists.php.net to get a copy of this message | ||
Admin wrote:
i assume you're joking - that code is simply going to give 6 list items all with the same value - $_GET['page'] please do check you know what you're talking about before you post.$categorys = array('home', 'services', 'gallery', 'about_us', 'contact_us', 'testimonials');If(in_array($_GET['page'], $categories)) { echo '<li><a href=index.php?page='.$_GET['page'].'>'.str_replace("_"," ",$_GET['page']).'</a></li>'; }else{ echo '<li>'.str_replace("_"," ",$_GET['page']).'</li>'; } I normally never write someones code for them but you are just not getting it. The above code works use it.