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> "; } ?> Quote Link to comment 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); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.