php 函数中的链接
我阅读并尝试了所有其他线程,但我似乎无法完成这项工作...
我有以下内容
$error_str .= "<tr><th>Warp Links</th><td>";
if($user['location'] > 0 && $user['location'] <= $uv_num_stars) {
// ensure user is in a system that exists.
print_link($star['link_1']);
print_link($star['link_2']);
print_link($star['link_3']);
print_link($star['link_4']);
print_link($star['link_5']);
print_link($star['link_6']);
$error_str .= $auto_str."</td>";
if(!empty($star['wormhole']))
$error_str .= "<th>Wormhole</th><td><a href=Navigation.php?toloc=$star[wormhole]>$star[wormhole]</a></td>";`
}
,这会打印存储在我的数据库中的数字链接,例如
<1>
我需要用图像替换该数字。到目前为止我已经尝试过
print_link($link['link_1'])<img src='/public/img/mail.png'/>";
,但我得到了一个意外的 T_STRING
我的 print_link 函数是
function print_link($link_num)
{
global $error_str;
if($link_num) {
$error_str .= "<<a href=\"Navigation.php?toloc=$link_num\">$link_num</a>> ";
}
我该怎么做?
感谢您的阅读。
这不是 WordPress 问题。
i read and tried all the other threads but i cannot seem to make this work...
i have the following
$error_str .= "<tr><th>Warp Links</th><td>";
if($user['location'] > 0 && $user['location'] <= $uv_num_stars) {
// ensure user is in a system that exists.
print_link($star['link_1']);
print_link($star['link_2']);
print_link($star['link_3']);
print_link($star['link_4']);
print_link($star['link_5']);
print_link($star['link_6']);
$error_str .= $auto_str."</td>";
if(!empty($star['wormhole']))
$error_str .= "<th>Wormhole</th><td><a href=Navigation.php?toloc=$star[wormhole]>$star[wormhole]</a></td>";`
}
and this prints a number link stored in my database, e.g.
<1>
I need to replace this number with an image. So far i've tried
print_link($link['link_1'])<img src='/public/img/mail.png'/>";
but i get an unexpected T_STRING
My print_link function is
function print_link($link_num)
{
global $error_str;
if($link_num) {
$error_str .= "<<a href=\"Navigation.php?toloc=$link_num\">$link_num</a>> ";
}
How can i do this?
Thank you for reading.
This is not a WordPress question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你应该从基础开始。找一本编程教程,买一本好的 php 书等等。即使我们给了你一个可行的答案,你也会遇到下一个问题。如果你想编写 PHP 代码,你就必须花一点精力学习编程。
一些链接:
反之亦然)。
PHP。
I think you should start from the basics. Find a programming tutorial, buy a good php book etc. Even if we gave you a working answer you would be stuck with your next problem. You have to put a little effort in learning programming if you want to code PHP.
Some links:
versa).
PHP.