Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8916295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:12:17+00:00 2026-06-15T05:12:17+00:00

without right-clicking the browser just to view the source, how to display php results

  • 0

without right-clicking the browser just to view the source, how to display php results as html markup so user can also copy it.

example:

$var = 'ipsum'; //user input stored in variable

<p style="align="center">Lorem <?php echo $var; ?> dolor sit amet</p>

output:

Lorem ipsum dolor sit amet

at the same time, I want to show the html markup so the user can directly copy it without viewing the source like so:

<p style="align="center">Lorem ipsum dolor sit amet</p>

How do I do this in php? appreciate the help. thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:12:18+00:00Added an answer on June 15, 2026 at 5:12 am

    try this :

    echo htmlentities('<p style="align="center">Lorem '.$var.' dolor sit amet</p>');
    

    or :

    $var = 'ipsum';
    $mark = '<p style="align="center">Lorem '.$var.' dolor sit amet</p>';
    
    echo $mark;
    echo htmlentities($mark);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goal: Display different context menu if right clicking a row from the listview or
I know you can apply a function/formula by clicking and dragging the bottom right,
Trying to detect left click vs right click (without using jQuery!) and I have
I'm trying to find a way to perform an indirect shift-left/right operation without actually
There's a shortcut to this without having to specify SET all the time right?
Is it possible to play sounds within an app without stopping iPod music? Right
How Do I deploy applications so that they require administrator rights without the end-user
Under MacOSX, I can create a file under root (/) without having admin rights.
What I want to do is simulate right clicking a stored procedure an selecting
I'm trying to call the onsubmit programmatically without clicking in the form button. First

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.