Hi all,
Does anyone know how to apply a function to alter every element of an array?
function myfunct ($string)
{
// code to change characters to
// lowercase then capitalize first letter
}
Instead of doing something like:
<?
$fname = myfunct ($fname);
$lname = myfunct ($lname);
---etc.---
?>
Can't I put everything in an array and do
the function just once?
Something like using the following array:
$form1 = array($fname,$lname,$address1,$city);
$form1[] = myfunct($form1[]); (??)
I tried the above and looping thru a for/next but it didn't work.
Any ideas?