Hello, I tried both, they both work except now they don't
add ".html" on the end. Oh, I also added _ to the start and end of
each word I need removed, otherwise it removes all instances of
those letters, including when they are IN another word ("toward"
becomes "ward").
Thanks!
Wretha
--- In [email protected], girish umanandan
<[EMAIL PROTECTED]> wrote:
>
> 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";
> ?>
>
>
>
> Bob <[EMAIL PROTECTED]> wrote:
> Hi Wretha,
> This maybe a more elegant solution:
>
> $title = "Bob <123> #*&%$£! to the Say's it and or with Hello too
also a if to";
> echo $title."
>
> ";
>
> $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);
>
> $filename = preg_replace("/[ ]+/", "_", $filename);
> echo trim($filename).".html";
> ?>
>
> Bob E.
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/