...

View Full Version : extract data from Function



simzam
12-24-2010, 11:45 AM
hello

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


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> ";
}
?>

adarshakb
12-24-2010, 12:31 PM
linksandid.php:


<?php
function idlink() {
$links=array();
for($i =1; $i <= 10; $i ++) {
$links[$i] = "<a href=\"http://localhost\123.php?page=$i\"> $i</a> ";
}
return $links;
?>




include('linksandid.php');
$links_returned = idlink(); here i want get all numbers and hyperlinks separately
foreach($links_returned => $i as $links)
{
//your codes
}
?>

simzam
12-24-2010, 12:53 PM
getting error

Parse error: syntax error, unexpected T_DOUBLE_ARROW in



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum