Trying to pass an array outside the scope into a function for echo'ing

-RaJ-

New Member
Hello my fellow programmers,I have a problem (other than not knowing enough) I need to know how to pass an array from outside the scope to then back inside, in a function which then echo's a specific array index.I have trowlled through the net trying to find solutions, asked fellow programmers for help but nothing thus far has worked.inside an include file I am creating the array:\[code\]$errmsg[0] = 'the message is too short, please enter more than 10 charaters.';$errmsg[1] = 'the message is too long, please enter less than 1000 charaters.';\[/code\]I then go on to serialize the array to keep it stored.\[code\]$e = serialize($errmsg);\[/code\]Then inside another include file I create my function.\[code\]function contact($e) { echo unserialize($errmsg[0]);}\[/code\]Lastly in the main index.php file I callback the function.\[code\]contact($e);\[/code\]Now this of course does not work and if any kind soul could put me on the right track or even give me the solution to fixing this I would be greatly appriciative.If you need any further information from me please say.p.s. I have now finished work for the day so my responses wont be until later tonight GMT.
 
Back
Top