HealthLinks is your destination for reliable, understandable, and credible health information and expert advice that always keeps why you came to us in mind.

How to Make a Sentence Wrap to the Next Line in PHP

104 16
    • 1). Right-click the PHP file you want to edit. Click "Open With," then click your PHP editor.

    • 2). Find the PHP string that you want to wrap in your Web page. If you do not have a string you want to use, use the following code to create a string in PHP:

      $content = "This is the sentence <br> you want to wrap";

      Notice the "<br>" tag in the middle of the sentence. This tag forces the sentence to wrap after the word "sentence."

    • 3). Write the statement to the page to display the results to your readers. After the HTML sentence is set up to wrap, you must "echo" the statement on your Web page. The echo statement is the PHP command that writes your HTML to the page when the page renders in the user's browser. The following code displays the wrapped sentence to the page:

      echo $content;

Source...

Leave A Reply

Your email address will not be published.