Jump to content

[SOLVED] Spliting paragraph into sentences and attach in excel


salman_ahad@yahoo.com

Recommended Posts

Here is what I am trying to do

 

example: Para1[123.456.789!] 3 sentences

            Para2[abc?defghij.klmnop! etc] 3+ sentences

 

It should split the paras into sentences based on delimiters (.?!), count the length of characters in those sentences.

 

If any sentence more than "120" charaters it should attach "..." at the end of sentence.

 

Then email the sentences in an excel(attached)

example.xls

 

123.

456.

789!

abc?

defghij.

klmnop!

dskasdjkasjkdjfkdgjkfgjflhkglfhkdljsakfjdkf...

 

Please send me sample code, please don't just tell me I can use explode() function or split....etc

 

for example

if ($_POST['Submit'])  //taking user input when Submit

{

$para = $_POST['para']; assigning it to para

}

$sent = explode(".",$para); exploding para when the "." is read

echo $sent[0];

echo $sent[1]; How do I enter to next line in between echo's?

echo $sent[2];

echo $sent[3];

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.