1

我用过下面的代码,

<?php
 $this->settings['copyright'] = array(
        'title'   => __( 'Copyright' ),
        'desc'    => __( 'Please enter the copyright text you wish to appear in the footer left.' ),
        'std'     => '©2012-'<?php echo date("Y"); ?> 'here i write some more', //here i am trying to echo it, but i get the error below
        'type'    => 'text',
        'section' => 'general'
    );
?>

我收到如下错误,

Parse error: syntax error, unexpected '?'
4

1 回答 1

3

尝试这个,

'©2012-'<?php echo date("Y"); ?> 'here i write some more',

应该

'©2012-'.date("Y").'here i write some more',

        <?php
         $this->settings['copyright'] = array(
                'title'   => __( 'Copyright' ),
                'desc'    => __( 'Please enter the copyright text you wish to appear in the footer left.' ),
                'std'     => '©2012-'.date("Y").'here i write some more', //here i am trying to echo it, but i get the error below
                'type'    => 'text',
                'section' => 'general'
            );
        ?>
于 2013-11-09T11:21:37.003 回答