Page 1 of 1

newbie questions

Posted: Sat Jul 19, 2008 5:48 am
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!

Re: newbie questions

Posted: Sat Jul 19, 2008 6:19 am
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