Hi Girish,
I tried that initially, but if any words are remove, this puts blank values in
the array which then cause multiple underscores. You'd still need a regex to
remove multi underscores, instead of spaces.
p.s.
I was trying to think of a way to remove words <=4 chars (just for learning
purposes), without trotting through an array manually.
I did notice "array_filter();" which sounds good, but didn't understand it :-(
Bob E.
----- Original Message -----
From: "girish umanandan" <[EMAIL PROTECTED]>
Use it with a slight change
<?php
$title = "Bob <123> #*&%$£! to the Say's it and or with Hello too also
a if to";
echo $title."<br /><br />";
$filename = strtolower($title);
$filename = preg_replace("/[^a-z ]/", "", $filename);
$remove =
array('to','the','it','and','or','with','too','also','a','if');
$filename = explode(" ", $filename);
$filename = array_diff($filename, $remove);
$filename = implode("_", $filename);
echo trim($filename).".html";
?>
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/