Go to line

Discussion in 'PHP' started by redhits, Nov 9, 2009.

  1. #1
    Is there any GO TO in PHP ? my problem is that from time to time i get a blank time (not my fault, but the partner server problem) , and if i get an blank page via php script, i would like to reload the script (do an GO TO LINE 0, to the begin of the script)
     
    redhits, Nov 9, 2009 IP
  2. Hosting24

    Hosting24 Member

    Messages:
    431
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #2
    I have never heard of this feature
     
    Hosting24, Nov 9, 2009 IP
  3. TSH-Nathan

    TSH-Nathan Greenhorn

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #3
    php.net/manual/en/control-structures.goto.php

    Hope that helps - its a new feature so make sure you've got the correct version installed.
     
    TSH-Nathan, Nov 9, 2009 IP
  4. Hosting24

    Hosting24 Member

    Messages:
    431
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #4
    Hm, looks really useful thing.
     
    Hosting24, Nov 9, 2009 IP
  5. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you should not use GOTO at all tbh. you can do this with 'do while' if needs be
     
    JAY6390, Nov 9, 2009 IP
  6. TSH-Nathan

    TSH-Nathan Greenhorn

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #6
    I agree, i'm not quite sure why they've included it at all, I cant picture a time where I will use it because a loop or a function is not good enough..
     
    TSH-Nathan, Nov 9, 2009 IP
  7. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #7
    yup. GOTO has been outdated since it was used in BASIC
     
    JAY6390, Nov 9, 2009 IP
  8. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #8
    Yeah , i know it's very outdataes, but i don't want to create a big while that will include all my script (200-300kb of code already)...
     
    redhits, Nov 9, 2009 IP
  9. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #9
    put your script in a function then? and just run the function and return with a specific value?
     
    JAY6390, Nov 9, 2009 IP