One new

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
ombdj
Forum Newbie
Posts: 2
Joined: Thu Jun 27, 2002 8:19 am
Location: India
Contact:

One new

Post by ombdj »

Hi All,

Sorry to disturb you guys. But I have to. Well, I am new to PHP.

I wrote
------------------------------
<?php

$a=" Biswa Dutta Jena ";
echo("<b>".trim($a)."</b>");
echo(htmlspecialchars("dfgdgdfgd",ent_quotes));


?>
-------------------------------


Is this wrong?

I am finding error.

Sorry to disturb you.
Bye
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Hi, all that's wrong is that you used the wrong case for a constant (ent_quotes instead of ENT_QUOTES), try

Code: Select all

<?php 
$a = 'Biswa Dutta Jena'; 
echo '<b>'.trim($a).'</b>'; 
echo htmlspecialchars('dfgdgdfgd', ENT_QUOTES); 
?>
Oh and to save you some typing, echo doesn't require parenthesis around the information in order to work.

Enjoy learning PHP :) ,
Mac
ombdj
Forum Newbie
Posts: 2
Joined: Thu Jun 27, 2002 8:19 am
Location: India
Contact:

Post by ombdj »

Thanx man

in one book it was in small letters.

Thanx once again.


bYE
Post Reply