i ahve a summary for example

hsssssssssssssssssssssssssssssssssssssssssssssssssssss
hsssssssssssssssssssssssssssssssssssssssssssssssssss
sbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

i wante to break these summary and dispaly only first line.

hsssssssssssssssssssssssssssssssssssssssssssssssssssss

which function i have to use?
any body please help me

This assumes the sentence ends with a period. I can't remember if this function will take an array of delimiters or not.

$strings = split(".",$summary);
echo $strings[0];

Edited 3 Years Ago by diafol: fixed formatting

This assumes the sentence ends with a period. I can't remember if this function will take an array of delimiters or not.

$strings = split(".",$summary);
echo $strings[0];

Don't think it will take an array of delimiters. But you could use:

$strings = preg_split("/.|;|:/",$summary); // delimiters . ; : 
echo $strings[0];

which will achieve the same as taking an array of delimiters. Will bbe slower though.


i tried explode function and it worked. but tahnks for your help

This question has already been answered. Start a new discussion instead.