RE: how would I do this?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: David McGlone [mailto:david@xxxxxxxxxxxxx]
> Sent: Monday, December 27, 2010 1:14 PM
> To: PHP
> Subject:  how would I do this?
> 
> Hi all,
> 
> I am trying to make the link in this code not show the underscore and I
can't
> figure out how I could do it. I've tried various different things I
thought
> would work. I've tried things like "lawn_maintenance"=> "lawn
> maintenance", I tried concatinating "lawn" . "maintenance" and various
> other things. The examples above both produce just the word "lawn"
> 
>  here's the code I have so far:
> 
> $services = array(lawn_maintenance, core_areation, over_seeding,
> hedge_trimming, mulch_installation, natural_debris_removal,
> leaf_cleanup_removal, snow_plowing);
> 

$services = array('Lawn Maintenance', 'Core Areation', 'Over Seeding',
'Hedge Trimming', 'Mulch Installation', 'Natural Debris Removal', 'Leaf
Cleanup Removal', 'Snow Plowing');

echo '<ul>';

 foreach ($services as $service){
// echo "<ul><li>&raquo; <a
href=index.php?page=$service>$service</a></li></ul>";
echo '<li><a href="index.php?page='.str_replace(' ', '_',
strtolower($service)).'">'.$service.'</a></li>';
 }

echo '</ul>';


Happy holidays, new year, & coding,
Tommy

> 
> Could anyone give me a hand? Obviously I don't understand arrays very well
> :-/
> 
> --
> Blessings
> David M.
> 
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux