尝试在php中插入php


Trying to insert php inside php

我曾尝试在这个php字符串中使用双引号和单引号。然而,没有成功。如何在php中调用php?

<?php echo wpws_get_content('<?php the_field('rate_my_professor_link''); ?>','.comment','html','user_agent=Bot+at+mysite.com&on_error=error_show&')?>

您只需要这样做:

<?php echo wpws_get_content(the_field('rate_my_professor_link'), '.comment', 'html', ''user_agent=Bot+at+mysite.com&on_error=error_show&'); ?>

您可以将函数直接放入其他函数中。