# Drop down code not working

**URL:** https://forum.kirupa.com/t/drop-down-code-not-working/291455
**Category:** Uncategorized
**Created:** [June 30, 2009, 3:18am UTC](https://forum.kirupa.com/t/drop-down-code-not-working/291455 "2009-06-30T03:18:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![spyderfx](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@spyderfx](https://forum.kirupa.com/u/spyderfx)
#### Post date: [June 30, 2009, 3:18am UTC](https://forum.kirupa.com/t/drop-down-code-not-working/291455/1 "2009-06-30T03:18:43Z")

</div>

Hi, I followed a tutorial to do a drop down menu in php and double checked it with a book I bought to make sure all the syntax is correct, but for some reason it isn’t working. Here is the code:

\<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”  
“[http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd)”\>

\<?php  
$category = array(  
‘1’ =\> ‘Sacramento’,  
‘2’ =\> ‘Roseville’,  
‘3’ =\> ‘Granite Bay’,  
‘4’ =\> ‘Eldorado Hills’,  
‘5’ =\> ‘Folsom’,  
‘6’ =\> ‘Lincoln’);

$category = str\_replace(" ", " ", $category);

echo ‘\<SELECT name=category\>’;

foreach ($category as $key =\> $value)  
{  
echo ‘\<OPTION value=’.$value.’\> ‘.$value.’;  
}

echo’\</select\>’;

?\>

I have a feeling maybe I installed the apache server wrong on my computer and it just can’t read it. Does anyone see anything wrong with this code?
