newbie questions

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
verymeanguy
Forum Newbie
Posts: 6
Joined: Sat Jul 19, 2008 5:40 am

newbie questions

Post by verymeanguy »

I am very new to php programming. So my questions will come across as being very amateurish.

First, how do I get the system date and time through php?

Second, what is the escape sequences like in php? Is it, for instance, \" for " like Java?

Thirdly, what are boolean AND and OR in php? Are they &&, || and &, | like in Java?

Thanks in advance!
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: newbie questions

Post by Oren »

verymeanguy wrote:First, how do I get the system date and time through php?
If you mean system = the server on which php is running on, then see the date() function. If you mean the date and time on the user end, you can't do that with php - use Javascript instead.
verymeanguy wrote:Second, what is the escape sequences like in php? Is it, for instance, \" for " like Java?
Yes, that's right :wink:
verymeanguy wrote:Thirdly, what are boolean AND and OR in php? Are they &&, || and &, | like in Java?
What do you mean by boolean? do you mean logical or bitwise?

Logical AND: "&&" and "and" - where "&&" has higher precedence.
Logical OR: "||" and "or" - where "||" has higher precedence.

Bitwise AND: "&"
Bitwise OR: "|"

Note: the bitwise operators has higher precedence over the logical operators. For instance: "&" has higher precedence over "&&", "and", "||" and "or".

See: http://us2.php.net/manual/en/language.o ... precedence
Post Reply