-4

My code is below

<?php echo '6p]<?mSKPQ'; ?>

Above code showing result like below

6p]

But I need like below

6p]<?mSKPQ

So what should I do for avoid to break string if string have php opening tag.

2 Answers2

2

Live Example. https://eval.in/924127

And Before Asking this type of question please read What is the difference between single-quoted and double-quoted strings in PHP

TarangP
  • 2,711
  • 5
  • 20
  • 41
0
echo htmlspecialchars('6p]<?mSKPQ');
Pasha
  • 158
  • 5