php help?

Discussion in 'OT Technology' started by SycoPhant, Jan 16, 2004.

  1. SycoPhant

    SycoPhant Get out my way

    Joined:
    Oct 8, 2001
    Messages:
    17,759
    Likes Received:
    0
    Location:
    Erie, PA
    I need this:
    Code:
    if($comments == 1) {$comments .= " comment";} else {$comments .= " comments";}
    
    To produce "comments [#]" instead of "# comments" (minus the quotes of course).
    I don't really know php that well, I just tool around with stuff that I borrow. Any ideas?
     
  2. Mirlyn

    Mirlyn Guest

    try
    Code:
    if($comments == 1) {$comments = "comment [$comments]";} else {$comments = "comments [$comments]";}
    
     
  3. SycoPhant

    SycoPhant Get out my way

    Joined:
    Oct 8, 2001
    Messages:
    17,759
    Likes Received:
    0
    Location:
    Erie, PA
    Sweet, that worked! Thanks!
     
  4. bkarle

    bkarle M4 > *

    Joined:
    Oct 23, 2003
    Messages:
    432
    Likes Received:
    0
    Location:
    Chesapeake, VA
    I never thought I'd see the day you tried to code php.
     

Share This Page