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/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.

  2. #2
    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) ;

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

    Default

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

    Code:
    <?php
    
    $myCat = 'I love my kitty';
    
    $myCat = str_replace('kitty', 'puppy', $myCat);
    
    echo $myCat;

  4. #4
    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.

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
  •