Page 1 of 2 12 LastLast
Results 1 to 10 of 34

Thread: Day 3 - String Operations - Become PHP Expert in 30 days.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    http://php.flashwebhost.com/sherly/mother.php

    Code:
    <?php
    $str = 'Mother is the name for God in the lips and hearts of little children';
    $str = strtoupper($str);
    echo $str; // MOTHER IS THE NAME FOR GOD IN THE LIPS AND HEARTS OF LITTLE CHILDREN

  2. #2
    Join Date
    Sep 2003
    Location
    india
    Posts
    11,527

    Default

    Hi,

    http://php.flashwebhost.com/annie/ucfirst.php



    Code:
    <?php
    $myMobile = 'i have a samsung galaxy s3';
    $myMobile = ucwords ($myMobile);
    echo $myMobile;
    echo '<br>';
    
    $myCar = 'i have a red car' ;
    $myCar = ucwords ($myCar);
    echo $myCar;
    echo '<br>';
    
    $bestFilm = 'RAAMJI RAO SPEAKING';
    $bestFilm = ucwords ($bestFilm);
    echo $bestFilm;

  3. #3
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    I got error http://php.flashwebhost.com/sherly/school.php

    Code:
    Fatal error:  Call to undefined function strtolower() in /home/fwhphp/public_html/sherly/school.php on line 5
    Code:
    <?php
    
    $schoolName = 'Little Flower School';
    
    echo strtolower ($schoolName);
    Last edited by sherlyk; 05-10-2014 at 06:00 AM.

  4. #4
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by sherlyk View Post
    I got error http://php.flashwebhost.com/sherly/school.php

    Code:
    Fatal error:  Call to undefined function strlower() in /home/fwhphp/public_html/sherly/school.php on line 5
    Code:
    <?php
    
    $schoolName = 'Little Flower School';
    
    echo strlower ($schoolName);
    function name is strtolower(), in the code to is missing.

    find

    Code:
    strlower
    Replace With

    Code:
    strtolower
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  5. #5
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    http://php.flashwebhost.com/sherly/bizhat.php

    Code:
    <?php
    
    $string1 = 'WELCOME TO BIZHAT.COM';
    echo strtolower($string1);

  6. #6
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    DAY 3 PHP PROGRAMMING

    http://php.flashwebhost.com/tom/strlen.php

    Code:
    <?php
    
    
    $movieName = 'Peruvannapurathe Visheshangal' ;
    
    
    echo strlen($movieName) ;

  7. #7
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by image View Post
    DAY 3 PHP PROGRAMMING

    http://php.flashwebhost.com/tom/strlen.php

    Code:
    <?php
    
    
    $movieName = 'Peruvannapurathe Visheshangal' ;
    
    
    echo strlen($movieName) ;
    Good

    Code:
    <?php
    
    $movieName = 'Peruvannapurathe Visheshangal' ;
    
    echo strlen($movieName) ;
    echo '<br>';
    echo strtolower($movieName) ;
    echo '<br>';
    echo strtoupper($movieName) ;
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  8. #8
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    http://php.flashwebhost.com/sherly/pen.php

    Code:
    <?php
    
    $myPen = 'I have a blue pen';
    
    $myPen = ucwords($myPen);
    
    echo $myPen;
    
    echo '<br>';
    
    $myPencil = 'I HAVE A GREEN PENCIL';
    
    $myPencil = ucwords($myPencil);
    
    echo $myPencil;
    Last edited by sherlyk; 05-10-2014 at 03:34 PM.

  9. #9
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    DAY 3 PHP PROGRAMMING

    http://php.flashwebhost.com/tom/strtoupper.php

    Code:
    <?php
    
    
    $movieName = 'Drishyam' ;
    $banner = 'Aashirvad Cinemas' ;
    $director = 'Jeethu Joseph' ;
    
    
    echo strtoupper($movieName) ;
    
    
    echo '<br>';
    
    
    echo strtoupper($banner) ;
    
    
    echo '<br>';
    
    
    echo strtoupper($director) ;

  10. #10
    Join Date
    May 2014
    Posts
    21

    Post code correction

    Quote Originally Posted by sherlyk View Post
    http://php.flashwebhost.com/sherly/pen.php

    Code:
    <?php
    
    $myPen = 'I have a blue pen';
    
    $myPen = ucwords($myPen);
    
    echo $myPen;
    
    echo '<br>';
    
    $myPencil = 'I HAVE A GREEN PENCIL';
    
    $myPencil = ucwords($myPencil);
    
    echo $myPencil;
    
    ?>
    In this code ?> is not necessary. ?> is used only when php is used in between other language codes.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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