"John Nichel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > web_singer wrote: > > I am using an array to create a menu and the code to change an image on > > mouseover. > > I would also like to change some text on mouseover. While i can do it using > > a swtich in javascript it requires that I hard code all the different > > options in. My whole reason for using the php in the first place was to > > avoid having to hard code anything at all. > > Does anyone have an idea how I can get the text portion to also use my > > variable? > > > > This is what i have so far... > > <? > > $site_pages = array("pageone", "pagetwo", "pagethree" ); > > > > $site_text = array("this is text one", "this is text two", "this is text > > three" ); > <snip> > > Why not just use a multi-dimensional array? > > $site = array ( > 1 => array ( > "page" => "pageone", > "text" => "this is text one" > ), > 2 => array ( > "page" => "pagetwo", > "text" => "this is text two" > ), > so-on, and so-forth... > ) > > -- > John C. Nichel > ÜberGeek > KegWorks.com > 716.856.9675 > [EMAIL PROTECTED]
Thanks for the response, I am very new to using PHP (really need a newbies section LOL) and while I can see how a multi-dimensional array would have been better than using two I am not sure how I would get my code to read that text in the mouseover. I can read the two arrays but cannot seem to tell the code that the variable i am passing in the mouseover is the object and not the text i want to display. Hope that you can help :) WebSinger --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.767 / Virus Database: 514 - Release Date: 09/21/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php