Link to home
Start Free TrialLog in
Avatar of BR
BRFlag for Türkiye

asked on

Php print out

How can i print out the value without using echo statement? I use it like this

<?php echo $value ?>
I know that there is another usage but i can not remember it
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Here are various ways of dumping variables and doing output - not sure what your application is but one of these should fit the bill
print_r()
var_dump()
print
var_export
printf
Then there is HEREDOC
$string = 'variables';
echo <<< LOTSOFTEXT
<p>
Any text, <b>tags</b> "double quotes" or 'single quotes' and {$string}
Over as many lines
as required.
</p>
LOTSOFTEXT;

Open in new window

Avatar of BR

ASKER

Dear Julian Hansen,

how would you write the below code if you were the writer?

<input type=hidden  name=id value='<?php echo $id ?>'

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BR

ASKER

thank you very much Julian Hansen. Best regards
You are welcome.