conversion

Discussion in 'PHP' started by khalidfarooq, Mar 30, 2010.

  1. #1
    how i convert a php statement into comments in a run time
     
    khalidfarooq, Mar 30, 2010 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    You can't. Why would you want to do that?
     
    stephan2307, Mar 30, 2010 IP
  3. Gray Fox

    Gray Fox Well-Known Member

    Messages:
    196
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Improve your logic, that doesn't make much sense
     
    Gray Fox, Mar 30, 2010 IP
  4. ThomasTwen

    ThomasTwen Peon

    Messages:
    113
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I don't understand what you want to say.
     
    ThomasTwen, Mar 30, 2010 IP
  5. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #5
    I assume that he wants to exclude code at certain times or conditions.

    I guess a IF statement would be the suitable option here.
     
    stephan2307, Mar 30, 2010 IP
  6. khalidfarooq

    khalidfarooq Greenhorn

    Messages:
    82
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #6
    dear you can,t understand .
    i explain it
    i make a php programme which have 15 statements
    i want to count them with a specific no such 5 so the next time statement no 5
    are become comment or delete how i do it
     
    khalidfarooq, Mar 30, 2010 IP
  7. Nyu

    Nyu Peon

    Messages:
    79
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    why do you want do delte or comment a code line at runtime? Do you want to prevent it's executiion? Then use if statements as stephan2307 already said. I still can't understand what you want.
    You have 15 statements in your script and want to randomly exclude one from execution?
     
    Nyu, Mar 30, 2010 IP
  8. khalidfarooq

    khalidfarooq Greenhorn

    Messages:
    82
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #8
    yes i want to exclude selected statement,
    when ever the loop is run
     
    khalidfarooq, Mar 30, 2010 IP
  9. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #9
    well why don't do yo something like this

    
    if ($no != 1) { 
      //run this code
    }
    if ($no != 2) { 
      //run this code
    }
    if ($no != 3) { 
      //run this code
    }
    if ($no != 4) { 
      //run this code
    }
    if ($no != 5) { 
      //run this code
    }
    if ($no != 6) { 
      //run this code
    }
    
    
    PHP:
     
    stephan2307, Mar 30, 2010 IP