Hi. I have an array for all the cars in a online game I'm making that look like this:
$GLOBALS['car_park'] = array (
"Toyota iQ3", "Think City", "Lancia Ypsilon", "Smart fourtwo", "Chevrolet Matiz", "Mazda 2", "Peugeot 107", "Nissan Micra", "Mercedes-Benz 310" /* dårlige biler */
, "Lexus IS-F", "BMW M3 CSL", "Volvo C30", "Dodge Challenger RT", "Audi S3", "Omnibus Sunrider" /* bedre biler vanskelighetsgrad i forhold til dårlige biler 2.45x */
, "Chevrolet Camaro SS", "Porsche GT2 RS", "Lotus Elise", "Rolls-Royce Phantom", "BMW 5-series", "DAF SB3000 Berkhof" /* bra biler 4x */
, "Lamborghini Murcielago", "Ascari A10", "McLaren F1", "Pagani Zonda R" /* sinnsyke biler 8x */
);
$car_name = "Rolls-Royce Phantom"
$car_nr = ?
I have a car name, what I need is the nr for the car. Which is 18 ($GLOBALS['car_park'][18]). How du I find that with a function? array_search?