Hi guys, im quite new to PHP so bare with me. I would like to create a "list generator" script. What I mean by that is I would like a script that does the following: Black desk Green desk yellow desk white desk --- I don't want to have type both words in, just input a list such as:black,green,yellow,white then have the script generate the above Hope that makes sense Thanks all!@!
$input = "black,green,yellow,white"; $items = explode(",", $input); function makeList($val) { echo $val . " desk <br />"; } array_walk($items, "makeList"); PHP: I am open for any PayPal donations
That seems like a non-conventional way to do this. $colors = array("Black", "Green", "Yellow", "White"); foreach ($colors as $color) { print "$color Desk\n"; } PHP: