simple php question??
- Started
- Last post
- 13 Responses
- stefanburt
Hey think this my first post here are me adding comments, so please feel free to take the piss and flame me with noobie comments please :D
But I'm learning php and was wondering why its acceptable to echo to the broswer using either echo("something to echo"); or echo "something to echo";
I would of thought that it being a method it would need the () to work what gives?
Cheers
- sparker0
echo() is not actually a function (it is a language construct) so you are not required to use parentheses with it. In fact, if you want to pass more than one parameter to echo, you must not enclose the parameters within parentheses.
- rabattski0
and to make it more confusing for you you can also use print.
- sparker0
in which case print is also a construct...not a function.
:)
there is also printf(), sprintf(), vprintf()...
welcome to programming.
- stefanburt0
aha haven't heard that term before cheers for the information sparker & rabattski.
After years of skirting the subject of programing I am finally starting to get to grips with it and I kind of like :D
Partly the reason I am interested in php is to get a job doing this full time what would you recommend I learn to prove I have a solid knowledge of php and raise myself above newbie status?
- iqfoundry0
Echo is a built in method. It was programmed that way to make it easier to use for some folks. No real reason for it, it just works both ways ;)
-S
- stefanburt0
aha haven't heard that term before cheers for the information sparker & rabattski.
After years of skirting the subject of programing I am finally starting to get to grips with it and I kind of like :D
Partly the reason I am interested in php is to get a job doing this full time what would you recommend I learn to prove I have a solid knowledge of php and raise myself above newbie status?
- stefanburt0
aha haven't heard that term before cheers for the information sparker & rabattski.
After years of skirting the subject of programing I am finally starting to get to grips with it and I kind of like it:D
Partly the reason I am interested in php is to get a job doing this full time what would you recommend I learn to prove I have a solid knowledge of php and raise myself above newbie status?
- stefanburt0
aha haven't heard that term before cheers for the information sparker & rabattski.
After years of skirting the subject of programing I am finally starting to get to grips with it and I kind of like it:D
Partly the reason I am interested in php is to get a job doing this full time what would you recommend I learn to prove I have a solid knowledge of php and raise myself above newbie status?
- stefanburt0
apart from the use of echo.
I've just learn't don't press the respond button more than once :D
sorry chaps
- rabattski0
wow. hold your horses, take it easy on the broadcast button there.
anyways, php rocks. my favorite language though.
- stefanburt0
got the tiger dashboard php.net widget already.
Got a couple of books and training videos so looking at the same elements of the language from different angles is a real help.
Php is really nice as the skills are really useful in actionscript which I have been using off and on for a while.
I just want to say this site is really nice as its got a good balance of design and tech at last a balance thats great.
- sparker0
well, welcome.