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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
southeastweb
Forum Newbie
Posts: 14
Joined: Sun Mar 21, 2004 3:28 am
Location: Florida

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

Post 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]
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

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

Post 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.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Click the first link in my signature.
Post Reply