Page 1 of 1

One new

Posted: Thu Jun 27, 2002 8:19 am
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

Posted: Thu Jun 27, 2002 8:27 am
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

Posted: Thu Jun 27, 2002 8:41 am
by ombdj
Thanx man

in one book it was in small letters.

Thanx once again.


bYE