can ne one explain me the diff between
1)define() and constant()
2)echo and print()
3)exit() and die()
thanx in advance
fuctions difference in php
Moderator: General Moderators
- hypedupdawg
- Forum Commoner
- Posts: 74
- Joined: Sat Apr 10, 2010 5:21 am
Re: fuctions difference in php
1) The define() and constant() functions work together like so;
2) There is almost no difference between print and echo - although echo is marginally faster.
3) exit() is just an alias of the die() fuction - they are exactly the same.
Code: Select all
<?php
define("GREETING","Hello you! How are you today?");
echo constant("GREETING");
?> 3) exit() is just an alias of the die() fuction - they are exactly the same.
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: fuctions difference in php
print accepts only 1 parameter.hypedupdawg wrote:2) There is almost no difference between print and echo - although echo is marginally faster.
echo will accept n number of parameters and concatenate them into 1 string.