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
    May 2014
    Posts
    21

    Default

    Code:
    <?php$company='bizhat';
    $sent=' HEY buddy how are you doing';
    echo 'hey '.ucwords($company.' is cooler ').strtolower('THAN ANYTHING.').strtolower(str_replace('buddy', 'man', $sent));
    echo '<br>'.str_replace('HEY','',$sent);
    http://php.flashwebhost.com/austin/day3.php

    Please post if you find anymore interesting php string functions!!

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

    Default

    Day 3 PHP Programming

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

    Code:
    <?php
    
    
    $movieName = 'Mammootty\'s Blockbustor Movie Drishyam';
    
    
    $movieName = str_replace('Mammootty', 'Mohanlal', $movieName);
    
    
    echo $movieName;

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

    Code:
    <?php
    
    
    $movieName = 'Mohanlal\'s Super Hit Movie Mayamohini';
    
    
    echo str_replace('Mohanlal', 'Dileep', $movieName);

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
  •