Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

petermae on "Parsing only first line of posts with php (before a )"

$
0
0

I need to extract the first line of the content of my posts with php. I also need to extract a number of characters fron the rest of the post.

E.g. my post content structure looks like this:

http://google.com/or-some-other-random-link

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec cursus quam at est lobortis, id euismod augue venenatis. Fusce quam nisl, aliquam vitae porta vel, dapibus ut augue. Etiam ultricies sem sed lacinia adipiscing. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

I'm not very well travelled in PHP, so I'm a bit at a loss. Should I do this with a loop of some sort? One that will end when it meets the
code? Or is there a better way?


Viewing all articles
Browse latest Browse all 8245

Trending Articles