Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • trim() string function in php

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 108
    Comment on it

    trim is a function in php which removes the whitespaces from the beginning and end of a string.
    but if we want to remove them from one side specifically then we will use these trim function for the left side trim ltrim() and for the right side trim rtrime(),

    example :

    <?php
          $str = "Hello World!";
          echo $str . "<br-->";
          echo trim($str,"Hed!");
    ?>
    

    output
    llo Worl

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: