Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2007
    Location
    Leeds, UK
    Posts
    514
    Thanks
    24
    Thanked 19 Times in 19 Posts

    PHP Parse error: parse error, expecting `T_FUNCTION'

    PHP Code:
    function randLetter(){
            
    $a = array(0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0,1,2,3,4,5,6,7,8,9);
            
    $max count($a)-1;
            
    $rand rand(0$max);
            return 
    $a[$rand];
        }
        
        function 
    genRandStr($chars){
            
    $out '';
            for(
    $i$i != $chars$i++){
                    
    $out .= $this->randLetter();
                }
            }
            return 
    $out;
        } 
    Help im getting a this error
    PHP Parse error: parse error, expecting `T_FUNCTION' in C:\inetpub\wwwroot\core\classes\core.cls.php on line 34

    and line 34 is the return $out;

    Whats wrong with it?
    Working towards a Internet where we don't have website just browser applications Kill the Hyper-link and say hello to 3D Games in the browser :)

  • #2
    Regular Coder
    Join Date
    Nov 2007
    Location
    Leeds, UK
    Posts
    514
    Thanks
    24
    Thanked 19 Times in 19 Posts
    Close Please:
    I just noticed 2 } where there should be one
    Working towards a Internet where we don't have website just browser applications Kill the Hyper-link and say hello to 3D Games in the browser :)

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You can mark your thread as "resolved", which is as close to closed as it can get.


  •  

    Posting Permissions

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