问题
I cant get this syntax to work, already tried modifying it many time.
<?php
echo
"<a href='".include 'go/randomlink.php'."'>".$item['stockid']."</a>";
?>
回答1:
For this to work, your other php file must simply echo some string.
randomlink.php:
<?php
echo "What came first the chicken or the egg?";
?>
index.php:
echo "<a href='";
include('go/randomlink.php');
echo "'>" . $item['stockid'] . "</a>";
hope this helps you.
来源:https://stackoverflow.com/questions/35811857/include-php-file-in-echo-html-code