Forum Moderators: coopster

Message Too Old, No Replies

Drawing certain number of characters from string

         

bobnew32

1:26 pm on Sep 14, 2003 (gmt 0)

10+ Year Member



Ok I have a variable that is about 3000 character long that is an article. I want to have a preview of the article so the viewer can see the first paragraph of it.

So, what I need to do is be able to draw the first 580 characters from the variable and assign it to a new variable. Please help, it should be a simple one line of code. Thx

killroy

1:52 pm on Sep 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



$summary=left($text,580)

Just a guess, I don't know PHP.

SN

bobnew32

1:53 pm on Sep 14, 2003 (gmt 0)

10+ Year Member



Is that correct or did you make it up?

justageek

3:24 pm on Sep 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



$newvar = substr($oldvar,0,580);