Page 1 of 1

Hi, I have a few PHP questions I'm sure some buffs will know

Posted: Tue Mar 23, 2004 12:46 am
by southeastweb
Hi,

So a I am beggining w/ php as of a few months ago and I am just trying to find some symbol definitions. If someone could explain to the best degree it would be greatly appreciated.

Here is the 1st: "!" as in (!feonf($fp))

2nd I'm reading a PHP book and there are examples in this format:

"string fread(int fp, int length);" I'm trying to fill the blanks, but am unsure of the meaning of the term "int", maybe I am just totally missing something here!

And 3rd: if anybody has any info of the switch statement in relation to else and else if, I'm still trying to work it out.

Thanks for any help! [php_man][/php_man]

Posted: Tue Mar 23, 2004 2:37 am
by CoderGoblin
Can't really help with the first question.

In reply to the second I recommend http://www.php.net/switch

Basically switch is used to replace IF THEN, ELSEIF, ELSEIF statements.

If you do not understand the instructions on the link ask again and I will try to give you more information.

Re: Hi, I have a few PHP questions I'm sure some buffs will

Posted: Tue Mar 23, 2004 3:26 am
by patrikG
southeastweb wrote:Hi,

Here is the 1st: "!" as in (!feonf($fp))
"!" stands for "is not". In this case it means "if is not end of file(filehandler)"
southeastweb wrote: 2nd I'm reading a PHP book and there are examples in this format:

"string fread(int fp, int length);" I'm trying to fill the blanks, but am unsure of the meaning of the term "int", maybe I am just totally missing something here!
That describes a function. The format of function descriptions in the PHP manual (as in any good manual) includes the variable type that is passed to and returned by the respective function.

"string fread(int fp, int length)" means: function fread returns a string and needs two variables of type integer as arguments (or parameters). If it would read:

"string fread(int fp, [int length])" it would mean that the last argument is optional.

Do spend some time reading the manual, it's a fantastic ressource. I'd especially recommend reading the chapter "Language Reference" which delves into much greater detail than I ever could.
Whatever your question regarding PHP, the manual should always be your first port of call. Even the most seasoned PHP developers have a copy handy.

Posted: Tue Mar 23, 2004 3:27 pm
by m3mn0n
Click the first link in my signature.