将字符串设为小写,放在哪里

I am trying to make a link only have lowercase characters so the link actually work.

I'm not sure where to put the following:

$menus[$s]['title'] = strtolower($menus[$s]['title']);

$menus[$s]['title'] is the string I want to have lowercase characters.

<? 

    $sql_menus="SELECT * FROM lb_categories WHERE parent_id = '".$menu[$c]['id']."'";
    $res_menus=mysql_query($sql_menus)or die(mysql_error());
    while($row_menus = mysql_fetch_array($res_menus, MYSQL_ASSOC)) {
        $menus[] = $row_menus; 
    }
    for($s=0;$s<count($menus);$s++){ ?>
    <li><a href="<? echo $menus[$s]['title']?>.html"><? echo $menus[$s]['title'] ?></a></li>

<? }unset($menus); ?>
        </ul>
        </li>

Just use the strtolower() function where you echo the filename:

<li><a href="<? echo strtolower($menus[$s]['title']); ?>.html"><? echo $menus[$s]['title'] ?></a></li>

Also you could use foreach instead for:

<?php foreach($menus as $menu): ?>
    <li><a href="<?php echo strtolower($menu['title']); ?>.html"><?php echo $menu['title']; ?></a></li>
<?php endforeach; ?>