Jump to content

Recommended Posts

mattal999, function array dereferencing is not implemented in PHP (there has been talk about it in the past, the RFC is currently "declined") so you can't access the 0th array item in that matter.  Also, there is no need to nl2br+explode the entire post (which may, in theory, be huge) if all that is going to be used is the first line.

 

So, on those notes, another way (of many!) would be something like:

 

echo strtok($row1['post_text'], "\r\n");

 

[ot]Using strtok a lot today.[/ot]

 

mattal999, function array dereferencing is not implemented in PHP (there has been talk about it in the past, the RFC is currently "declined") so you can't access the 0th array item in that matter.  Also, there is no need to nl2br+explode the entire post (which may, in theory, be huge) if all that is going to be used is the first line.

 

So, on those notes, another way (of many!) would be something like:

 

echo strtok($row1['post_text'], "\r\n");

 

[ot]Using strtok a lot today.[/ot]

 

thanks that worked great!!

 

now now if i wanted to show everything after the first line, would it consist of something similar to that?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.