Results 1 to 4 of 4

Thread: if many question?

  1. #1
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default if many question?

    Is this possible?

    If this1 = 0
    and this2 =0
    and this3 =0

    then this0 =hello

    Cheers!

  2. #2
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    PHP Code:
    $this = array();
    if ((
    $this[1] == "0") && ($this[2] == "0") && ($this[3] == "0")) {
    $this[0] = "hello";

    EDIT: Didnt know that...
    Last edited by boxxertrumps; 03-17-2007 at 07:05 PM.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You're missing a semicolon--
    $this["0"] = "hello";

    Additionally, for numeric arrays, you don't need to have quotes around the number.

    Just $this[0] would be fine.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Talking

    thank you both very much!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •