简体   繁体   中英

How do I rewrite an PHP echo inside a PHP echo?

I want to place this code:

<?php echo Sabai::_h($entity->getAuthor()->email);?>

inside of this code:

<?php echo get_avatar( 'email@example.com', 32 ); ?>

where it says email@example.com . Can someone write this so I can understand?

Try this:

<?php echo get_avatar( Sabai::_h($entity->getAuthor()->email), 32 ); ?>

Or:

$email = Sabai::_h($entity->getAuthor()->email);
<?php echo get_avatar( $email, 32 ); ?>

Try out in this way. as ocanal said. PHP echo inside echo taken from his example

     echo '<td align="left"><a href="'.url('Forum/create_new_post?topic_id='.$post->topic_id.'&forum_id='.$post->forum_id.'').'"><img src="'.SITE_URL.'/lib/skins/flyeuro/images/forums/t_reply.gif"/></a></td>';

or you can also refer this link for your reference. How to write php echo inside echo

please modify according to your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM