+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Learning PHP

  1. #1
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Learning PHP

    Well, I'm 5 weeks before in PHP class, and my teacher don't know what I should do, neither do I.

    Can anyone give me something to do that will take around 60 - 80 minutes?

  2. #2
    jrobert755 is offline x10Hosting Member jrobert755 is an unknown quantity at this point
    Join Date
    Jan 2009
    Posts
    15

    Re: Learning PHP

    do you mean behind? if so, try tizag.com
    its a great html, java, php, and php/mysql tutorial website

  3. #3
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Learning PHP

    Quote Originally Posted by jrobert755 View Post
    do you mean behind? if so, try tizag.com
    its a great html, java, php, and php/mysql tutorial website
    No I am before everyone else. My teacher didn't expect someone to already know PHP, so he did no extra things for me.

    I am like a secondary teacher, and that isn't fun, because they are asking to easy questions.

    Like a guy didn't know how to use echo, *facepalm*

  4. #4
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: Learning PHP

    Hey vigge, haven't seen you in a while... *cough* long while *cough*
    If you don't say what you already know in php it's quite hard for anyone to give you an idea of something to do. Just think of something you might be able to make (or maybe it's more fun if you think you won't be able to make it) and make it.
    If you need a function, don't know how to do something or things like that there's a very useful site www.php.net ;)
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  5. #5
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Learning PHP

    Quote Originally Posted by marshian View Post
    Hey vigge, haven't seen you in a while... *cough* long while *cough*
    If you don't say what you already know in php it's quite hard for anyone to give you an idea of something to do. Just think of something you might be able to make (or maybe it's more fun if you think you won't be able to make it) and make it.
    If you need a function, don't know how to do something or things like that there's a very useful site www.php.net ;)
    Long time, no see :D

    I know for loops, while loops, if cases, switch, functions, math, basic SQL (insert, select, order), Own sorting algorithm.

    So all basic, you know.

    My teacher gave me to solve the fibonacci numbers and primes up to 100, which I both did in 1 lesson.

  6. #6
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Learning PHP

    build your own software in the time that others are learning it :P. your teacher can grade you on that, depending on how much they actually know about it.

    talk it over or see what college level classes are teaching ;)

  7. #7
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: Learning PHP

    Quote Originally Posted by vigge_sWe View Post
    Long time, no see :D

    I know for loops, while loops, if cases, switch, functions, math, basic SQL (insert, select, order), Own sorting algorithm.

    So all basic, you know.

    My teacher gave me to solve the fibonacci numbers and primes up to 100, which I both did in 1 lesson.
    Fibonacci is too easy =/
    Prime numbers are more of a challenge, because there's no way to determine whether a number is a prime number based on the previous number... The only way I can see to do that is brute force...

    But... numbers are boring, it's always the same ^^
    It's much more interesting to build something that is dependant on user input. If your scripts don't have a time limit you could dive into plain sockets and let 2 scripts communicate with each other (one acting as a server, one acting as a client). It gets even more fun when you combine 2 languages like that, but I doubt your php teacher will like that

    I've got something a friend told me once that you can make. You know that total bs where they determine the love % between two people? It's not a random number...
    This is how it works, based on an example:
    Name 1: imnotanoob
    Name 2: yesyouare
    You count the amount of times each letter is in the names:
    #a: 2
    #b: 1
    #e: 2
    #i: 1
    #m: 1
    #n: 2
    #o: 4
    #r: 1
    #s: 1
    #t: 1
    #u: 1
    #y: 2
    In Array-form: (2, 1, 2, 1, 1, 2, 4, 1, 1, 1, 1, 2)
    Then you take the first and the last letter (of the letters which are available) and you add that to a new array. (If the number of available letters is odd, you just leave the middle one (eg. (1, 1, 1) => (2, 1))
    The example becomes then: (4, 2, 3, 2, 2, 6)
    Just repeat that, and when the number exceeds 9, you take the ciphers and count them together to get a new number (eg. 12 => 1+2 = 3)
    (10, 4, 5) => (1, 4, 5)
    Eventually you only have 2 numbers left, that's the actual result:
    (6, 4)
    (Guess how many times you get something with an 0 in it? 0 times ;))
    So the love % between imnotanoob and yesyouare would be 64%.

    Have fun programming ;)

    Or you could just try to recreate my signature =P
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  8. #8
    JKoltner is offline x10Hosting Member JKoltner is an unknown quantity at this point
    Join Date
    Jan 2009
    Location
    Wimer, Oregon
    Posts
    23

    Re: Learning PHP

    Quote Originally Posted by marshian View Post
    Fibonacci is too easy =/
    Prime numbers are more of a challenge, because there's no way to determine whether a number is a prime number based on the previous number... The only way I can see to do that is brute force...
    There are actually some very clever methods to somewhat reduce the time needed to determine whether or not a number is prime, although understanding how some of them actually work requires an upper-class college or graduate level mathematics background.

    But... numbers are boring, it's always the same ^^
    I agree, if you're just trying to learn PHP, writing math programs is probably more depressing than useful.

    It's much more interesting to build something that is dependant on user input.
    Yep, also agree.

    If your scripts don't have a time limit you could dive into plain sockets and let 2 scripts communicate with each other (one acting as a server, one acting as a client). It gets even more fun when you combine 2 languages like that, but I doubt your php teacher will like that
    If his teacher is any good he'll be most impressed and encourage him.

    ---Joel

  9. #9
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Learning PHP

    Quote Originally Posted by marshian View Post
    Prime numbers are more of a challenge, because there's no way to determine whether a number is a prime number based on the previous number... The only way I can see to do that is brute force...
    PHP Code:
    function isPrime($i)
          {
             if(
    $i != 1) return false;
              
    $d 3;
              
    $x sqrt($i);
              while (
    $i $d != && $d $x$d += 2;
              return ((
    $i $d == && $i != $d) * 1) == true false;
           }
    for(
    $i 0$i <= 100$i++){
        
    $No[$i] = $i;
        
            if(
    isPrime($No[$i])) {
            echo 
    "$i<br />";
            
        } 


  10. #10
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Learning PHP

    :/

    My teacher didn't accept that solution. I hope he accepts this, which I wrote all by myself:

    PHP Code:
    for($i 0$i <= 100$i++){
        
    $No[$i] = $i;
        
    $True true;
        
    $True2 true;
        
        if(
    is_int($No[$i]/2)) {
            
    $True false;
            
    $No[$i] = -1;
        }
        
        if(
    $True) {
            if(
    is_int($No[$i]/3)) {
                
    $True2 false;
                
    $No[$i] = -1;
            }
        }
        
        if(
    $True2) {
            if(
    is_int($No[$i]/5)) {
                
    $No[$i] = -1;
            }
        }
         if(
    $No[$i] == 1) {
            
    $No[$i] = -1;
        }
        
        
    $No[2] = 2;
        
    $No[3] = 3;
        
    $No[5] = 5;
        
    $No[49] = -1;
        
    $No[77] = -1;
        
    $No[91] = -1;
        
        if(
    $No[$i] > 0) {
            echo 
    $No[$i]."<br />";
        }
        



+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 03-10-2008, 12:22 PM
  2. SUHOSIN - Use of eval is forbidden
    By MaestroFX1 in forum Free Hosting
    Replies: 19
    Last Post: 03-07-2008, 02:42 AM
  3. "PHP Startup: Invalid Library" - Interesting error
    By javaguy78 in forum Free Hosting
    Replies: 5
    Last Post: 03-27-2007, 02:33 PM
  4. Learning PHP and Graphic dummies books
    By SEŅOR in forum Off Topic
    Replies: 3
    Last Post: 05-21-2006, 08:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers