Parsing only first line of posts with php (before a )
-
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:
https://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?
- The topic ‘Parsing only first line of posts with php (before a )’ is closed to new replies.