So, I wrote a little function the other day to fetch an array of elements out of character-separated-data (like "value1|value2|value3", but then fetched into an array using explode()). The only thing is just that it isn't working at all[/]. Every time I run the function, and catch it as an variable to use it as an array, it simply outputs the word "media", with each character separated into one array-element. Could anybody figure out what's wrong with my code? (Aside from my style, I know it's horrible. I'm halfway learning OOP) Any help would be greatly appreciated.
if(!function_exists('getText')) {
function getText($item) {
$text = explode(" | ", $data["text"][$item]);
$text = Array(0=>"")+$text;
return Array(1=>$data["text"][$item]); //outputs Array(0=>"", "m", "e", "d", "i", "a")
}
}
17852_.zip