for starters you creating functions in a loop... wft lol

foreach(....){
function xxx(){}
}

this means that the function is being created multiple times!

i see your using smarty, why not create a smarty plugin with that function and then use like

{$linkdetail.URL|alexaRank}
litewarez Reviewed by litewarez on . Little coding help This is the code. I can see output for a site's alexa like GOOGLE. But not for variable $linkdetail.URL but when I use $linkdetail.URL it gives me the link. OUTFILE HERE - http://www.warez-core.com/details/link-1 Any help in correcting this part in the code ? <td><strong>Alexa Rank of {$linkdetail.TITLE} </strong></td> <td> {php}echo alexaRank($linkdetail.URL);{/php}</td> Rating: 5