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 4090756
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:16:44+00:00 2026-05-20T19:16:44+00:00

I have used html_entities for UTF-8 in php. $input = <div> ‘Testing’ </div>; echo

  • 0

I have used html_entities for UTF-8 in php.

$input = "<div> 'Testing' </div>";

echo htmlentities($input,ENT_NOQUOTES,"UTF-8");

But, above encoding is working for normal input, if i give below input and use encoding then I am getting blank output.

$input = "<div>Other 'user' is working on this line. Please contribute the next line.</div>";

echo htmlentities($input,ENT_NOQUOTES,"UTF-8");

I dont know how this is giving blank output.
If i print $input then I am getting below value in $input.

<div>Other user working on this line.�Please contribute the next line.</div>

Is any thing missed in htmlentities code, Please folks provide your suggestions.

Thanks,

-Pravin.

  • 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-05-20T19:16:45+00:00Added an answer on May 20, 2026 at 7:16 pm

    Try passing $input to utf8_encode first, and then passing the data to htmlentities with only the ENT_NOQUOTES option set:

    <?php
    
    $input = "<div>Other 'user' is working on this line. Please contribute the next line.</div>";
    echo htmlentities(utf8_encode($input),ENT_NOQUOTES);
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am quite new to utf-8 encoding and have used htmlentities() ever since, but
I used the function htmlentities() in my php script, but the server says: undefined
I have used PHP array for HTML select, then I put my codes in
I have used the silverlight control in CRM 2011.It also published on form but
I have a problem with my php XML generator class; I used XML Creator
I have used fieldset tag in HTML page, whereby i need some text to
see jsbin I have to make my html table vertically scrollable. I have used
I have a component that used to work (Without setting HTML tags to the
I have n number of select elements in an html page that are used
I have the following HTML: <section id=sidebar class=grid_3> <section id=content class=grid_9> I used jQuery

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.