Jump to content


Photo

simple question


  • Please log in to reply
6 replies to this topic

#1 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 07 August 2006 - 11:57 PM

I feel stupid for having to ask this but you know what they say

The only stupid question is the one left unasked


Anyways, How can I say and in php. That may not make sense but here is or
if ($something || $something_else == "whatever") {
    //do something
}

So what I want to do is if something and something_else == whatever

Thanks,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#2 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 08 August 2006 - 12:08 AM

&&
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

#3 Chevy

Chevy
  • Members
  • PipPipPip
  • Advanced Member
  • 163 posts

Posted 08 August 2006 - 12:12 AM

or you can just do this

if ($something == NULL AND $something_else == NULL){
//Whatever


#4 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 08 August 2006 - 12:12 AM

Thanks for the help.

Also * means and.

Thanks for the help,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#5 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 08 August 2006 - 12:22 AM


Also * means and.


I must be misreading this because, "*" definitely does not mean "and". It means "all".
PHP Ninja

#6 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 08 August 2006 - 06:33 AM

* is the mathamatical operator for multiplication in php. It has NO other meaning.

#7 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 08 August 2006 - 01:12 PM

Also * means and.


I must be misreading this because, "*" definitely does not mean "and". It means "all".

If you are using it in a mysql query then yes, but not in PHP.

Read thropes post for the meaning of the * operator in PHP.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users