how to adapt HTML character entities to PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jggrossm
Forum Newbie
Posts: 1
Joined: Thu Jun 19, 2008 11:17 am

how to adapt HTML character entities to PHP?

Post by jggrossm »

Hi all -

I want to create a line that's basically:

Code: Select all

print "Search Results with phrase " $phrase "";
Obviously, this won't work b/c the semi-colon at the end of the character entity end the line. I've tried breaking it out into variables, too, and that doesn't run.

How are HTML character entities usually adapted to PHP given they all end in semi-colons?

Thanks in advance!!!

JG
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: how to adapt HTML character entities to PHP?

Post by Christopher »

Have you tried it? That will work fine. Semi-colons between quotes are considered part of the string, not part of the statement.
(#10850)
Post Reply