Jump to content

Return Array from function.


Xname

Recommended Posts

Hi,Dear Frnds...........................I Hope U r all fine.

I am using php.Here is the problem in the Return array from function.

This is the code.

<?php
$store = array();

$test = get_my_links();
print_r($store);

function get_my_links() {

$my_array = array('e','f','g');

foreach($my_array as $key=> $list) {

$store[] = $list;

}
return $store;

}
?>

 

Suppose the array is maked dynamically.

please help me..THANKS...

 

Link to comment
https://forums.phpfreaks.com/topic/262482-return-array-from-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.