How do i do this?

Discussion in 'PHP' started by demondestiny, Aug 14, 2010.

  1. #1
    Hi all im currently creating a console mode php program that prompts the user for a string intil the user enters quit. Once quit has been entered it will then prompt the user if they want it converted to upper or lower case, and then redisplay it. Heres the code so far,

    
    #!/usr/local/bin/php -q
    <?php
    //phpprogram.php
    require ("phpio");
    print("\n ");
    $txt="type the word quit";
    print $txt;
    print ("\n\n");
    $input = input();
    if ($txt <=$txt)
    {
      print("\n  ");
      print "do you want to convert this to upper or lower case";
    }
    print ("\n\n");
    $input = input();
    print ("\n\n");
    ?>
    
    Code (markup):
    I've never done upper/lower case before so i'm not sure how to even do it. Anyone know what i need to do and the code i need to add? Thanks.
     
    demondestiny, Aug 14, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    danx10, Aug 14, 2010 IP
  3. demondestiny

    demondestiny Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No problem :) Any help at all would be much appreciated.
     
    demondestiny, Aug 14, 2010 IP
  4. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #4
    Well what I posted should solve/answer your question.
     
    danx10, Aug 14, 2010 IP