开发者

PHP statement between quotes

开发者 https://www.devze.com 2023-03-20 00:27 出处:网络
How can I put a php statement between quotes, inside php? I want to call str_replace(), and the first argument is a string that is a PHP statement, that I want to replace).

How can I put a php statement between quotes, inside php?

I want to call str_replace(), and the first argument is a string that is a PHP statement, that I want to replace).

The string is: <?php echo $_GET['number'];?>

Now, how do I put that 开发者_如何学JAVAinto quotes? Is it possible? I just want that to be treated as a string.

Thank you!


Is this all you're trying to do?

echo '<?php echo $_GET["number"];?>';

I think we're a little confused.


If you want to output that exact text to an html page just do

<?php
echo htmlentities('<?php echo $_GET["number"];?>');

I may have misunderstood what you wanted though...

0

精彩评论

暂无评论...
验证码 换一张
取 消