dselp3944 2014-07-02 21:27
浏览 48
已采纳

PHP里面有一个echo函数吗?

I have this part of the code of a plugin, which continues and has much php before it, fluidly without the ?> till the end of all the code.

function fivu_thumbnail_meta_box_html() {
echo '<label for="featured_image_url">';
_e("URL of featured image", 'fivu_textdomain' );
echo '</label> ';
echo '<input type="text" id="featured_image_url" name="featured_image_url" value=""    size="30" />'; 
}

What i need is to change the input value="" (5th line) to this:

value="<?php get_post_custom_values("Poster"); ?>" 

But as i am inside of an echo, the php is not interpreted as php but as normal text. ¿What can i do to make the php inside of the echo not to be interpeted as normal text?

EDIT: Ok, i am using

echo '<input type="text" id="featured_image_url" name="featured_image_url" value="' .    get_post_custom_values("Poster") . '"    size="30" />'; 

But i forgot, lol, i need to echo the value. So how do i add: echo $values[0]; ?

  • 写回答

3条回答 默认 最新

  • dqpc1845 2014-07-02 21:40
    关注

    I don't like HTML in echo.

    So Try :-

    function fivu_thumbnail_meta_box_html() {
    ?>
    <label for="featured_image_url">
    <?php
    _e("URL of featured image", 'fivu_textdomain' );
    ?>
    </label>
    <input type="text" id="featured_image_url" name="featured_image_url" value="<?php echo get_post_custom_values("Poster"); ?>"  size="30" />
    <?php 
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 eclipse连接sap后代码跑出来空白
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?
  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi