simzam Posted December 24, 2010 Share Posted December 24, 2010 I want to get loop numbers and hyperlinks from other included file function how to call function that gives me all 1-10 numbers and hyperlinks thanks <?php include('linksandid.php'); idlink(); here i want get all numbers and hyperlinks separately ?> linksandid.php: <?php function idlink() { for($i =1; $i <= 10; $i ++) { $links = "<a href=\"http://localhost\123.php?page=$i\"> $i</a> "; } ?> Link to comment https://forums.phpfreaks.com/topic/222573-extract-data-from-function/ Share on other sites More sharing options...
litebearer Posted December 24, 2010 Share Posted December 24, 2010 perhaps... <?php function idlink() { for($i =1; $i <= 10; $i ++) { $links[$i-1] = "<a href=\"http://localhost\123.php?page=$i\"> $i</a> "; } return $links; } $links_array = idlink(); print_r($links_array); ?> Link to comment https://forums.phpfreaks.com/topic/222573-extract-data-from-function/#findComment-1151075 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.