Hi All.
I’m looking to write a function to save me a lot of time.
I have a very large text file that I need to be formatted into html and thought I could use php to do it for me without having to go the full file. I will need to do this alot so having a funtion hand would be great.
For example look at this paragraph:
When he heard the car, the man stood up. He brushed pine needles off the seat of his jeans, then hurried out of the forest and trotted down to the roadside. As he neared the moonlit pavement, headlights swept around a corner to the south. They were very low and close together.
_Could be a Jaguar._
_Has to be_, he thought.
I want it to look like this:
When he heard the car, the man stood up. He brushed pine needles off the seat of his jeans, then hurried out of the forest and trotted down to the roadside. As he neared the moonlit pavement, headlights swept around a corner to the south. They were very low and close together.
<i>Could be a Jaguar.</i>
<i>Has to be</i>, he thought.
I don’t need to worry about the line breaks incidentally.
I think I need some sort of str_replace() function with a rule to add “” or “” depending on the ‘replace count’ being odd or even.
I’ve had a look around but can’t find anything that is pointing me in the right direction.
Any help would be appreciated!