Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use wordwrap() Function in php ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 143
    Comment on it

    What is wordwrap() Function in php ?

    wordwrap() Function wrap a string into incipient lines when it reaches a concrete length.

    So,basicaly use of wordwrap() wraps a string into new lines. wordwrap() include space also.

    You can take reference form below example to wraps a string into new lines.

     <?php
              $textword = "Hello Mr.Jorden how are you ? I hope you are doing well.";
              // here $textword is a variable 
    
              //now use the wordwrap() for incipient lines and define lenth of word
              $textword = wordwrap($textword, 10, "<br />");
                 print $textword;
              // print the $textword variable 
    
        ?>
    

    so in wordwrap() we use 10 limit of length of word and wordwrap() contain space also

    then, output will come following:

    Hello

    Mr.Jorden

    how are

    you ? I

    hope you

    are doing

    well.

 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: