I've been writing a script that puts some posted variables together, then formats them in a certain way and outputs them to the browser.
This is all pretty simple, and I managed to use a multidimensional array to store the first names and last names of the people inputted. However, to save space, I decided to turn this into a function, and then call the function. However, the values don't want to work with the function, and I'm really confused!
First of all, I create the multidimensional array:
Code: Select all
$names = array(array( $first, $last) );Code: Select all
function namearray( $names, $fname, $lname) {
$namesї] = array( $fname, $lname ) ;
}Code: Select all
namearray($names, $first2, $last2);K