By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

Transferreing array values out of a function into another array

P: n/a
I need to find a way to transfer all the values of an array inside a
function out of the fuction into another array. IE

function splice($filename){
if(file_exists($filename)){
$value=array("0"); // clear the array.
$rows=file($filename); // break text file into a rows array
for($num=0;$num < count($rows); ++$num){
$column=split(";",$rows[$num]);
$value[$num]=$column;}}
return $value;
}

$array1 = splice(file.txt)
Example file data would be

data1;an1;bc1
data2;an2;bc2
data3;an3;bc3

How do I go about getting the function to pass all it's data to the variable
$array1?
Thanks in advance.

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Tek9_AK wrote:
I need to find a way to transfer all the values of an array inside a
function out of the fuction into another array. IE

function splice($filename){
if(file_exists($filename)){
$value=array("0"); // clear the array.
$rows=file($filename); // break text file into a rows array
for($num=0;$num < count($rows); ++$num){
$column=split(";",$rows[$num]);
$value[$num]=$column;}}
return $value;
}

$array1 = splice(file.txt)
Example file data would be

data1;an1;bc1
data2;an2;bc2
data3;an3;bc3

How do I go about getting the function to pass all it's data to the variable
$array1?
Thanks in advance.

You've made this same post/question twice - Check the more recent post
that I've replied to...

randelld
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.