Jump to content

[SOLVED] what is the best way to do this?


shedokan

Recommended Posts

from an array.

and I figured it out myself.

here's what I got bt is there a better way of doing this?

<?php
$ctgs = array("hello", "test", "apple", "pizza");
for($i=0; $i<=3; $i++){
$name = $ctgs[$i];
   if ($name == "test")
      echo '<b>'.$name.'</b> | ';
   else
      echo "<a href='page.php?id=$name'>$name</a> | ";
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.