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条)

报告相同问题?

悬赏问题

  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持