I'm trying to tidy some code up and put it in a function, my problem is that I am only getting the first letter of a string back now.
The function I am using is this:
function Decoder($decode){ // Get URL Encoded Text held in an array and decode
$count=count($decode);
for ($i=0; $i<$count; $i++) {
$decode[$i] = urldecode($decode[$i]);
return ($decode[$i]);
}
}
I am calling the function like so:
list($decode[$i]) = Decoder($location); // Decode the array, and return the string back to this page
echo "RESULT:$decode[$i]";
Initially I was justing echoing the values from the function, but need to be able to put them in an SQL statement hence having to return them.
Soon as I tried to return them back to the PHP page, I just get the first letter e.g All, comes back as A and so on.