• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

Wordwap at character instead of #?

Is it possible to do something like wordwrap, but inserting a new line after a certain character (in my case: >), instead of after a certain number of characters?
0
n00b0101
Asked:
n00b0101
1 Solution
 
sirbountyCommented:
Hello n00b0101,
replace the character with a chr(13) & chr(10) - equivalent to a carriage return and line feed.

~sirbounty
0
 
BrianGEFF719Commented:
$theString = "This is a simple>Test of replacing a less than with a >New Line and a less than";

$theString = str_replace( ">", ">\n", $theString );
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now