multiple string separator for explode
Posted: Sun Jun 03, 2007 12:04 am
hello, i need some help regarding explode function. I want to use a multiple string separator for my explode function. Im exploding sentences with different punctuation marks like "!" or "?" or ","
what i have done is just for sentences that ends with a period.
but when i used separate explode syntx it will just output everything.
please help me. thank you.
Here is an example:
what i have done is just for sentences that ends with a period.
but when i used separate explode syntx it will just output everything.
please help me. thank you.
Here is an example:
Code: Select all
//this is a code
<?
$var= $_POST['textfield'];
$mypar=explode('.',$var);
//sentence
foreach($mypar as $b)
{
echo "$b - This is a sentence - Ends with a period";
echo "<br/>";
echo "<br/>";
}
?>