On 3/15/07, Ford, Mike <[EMAIL PROTECTED]> wrote:
On 14 March 2007 08:25, Richard Lynch wrote:
> On Tue, March 13, 2007 9:10 am, Todd Cary wrote:
> > I would like to write a filter that takes the text "smith" or
> > "SMith" and returns "Smith"; same for "ralph smith".
>
> No, you don't. :-)
>
>
On 14 March 2007 08:25, Richard Lynch wrote:
> On Tue, March 13, 2007 9:10 am, Todd Cary wrote:
> > I would like to write a filter that takes the text "smith" or
> > "SMith" and returns "Smith"; same for "ralph smith".
>
> No, you don't. :-)
>
> You *think* you want to write that function, but t
On Tue, March 13, 2007 9:10 am, Todd Cary wrote:
> I would like to write a filter that takes the text "smith" or
> "SMith" and returns "Smith"; same for "ralph smith".
No, you don't. :-)
You *think* you want to write that function, but this is one of those
things that is *way* more complicated th
>
> Thank you! I did not know about the ucwords() functions, and it
> does not need the string set to lower case.
>
> Now to create a filter that returns only numbers (e.g. "a1234z"
> -> "1234") and the same for non-numbers.
>
[Peter Lauri - DWS Asia]
This to replace all non-digit characters
Steve wrote:
For your filter to return only/no digits, I would recommend doing a bit of
reading on preg_replace ( http://us2.php.net/preg_replace ) while noting the
following flags:
\d
Matches any decimal digit; this is equivalent to the class [0-9].
\D
Matches any non-digit character; this i
For your filter to return only/no digits, I would recommend doing a bit of
reading on preg_replace ( http://us2.php.net/preg_replace ) while noting the
following flags:
\d
Matches any decimal digit; this is equivalent to the class [0-9].
\D
Matches any non-digit character; this is equivalent to
> I would like to write a filter that takes the text "smith" or
> "SMith" and returns "Smith"; same for "ralph smith". Is the a
> good source on using filters this way?
>
$bar = ucwords(strtolower($bar));
This is an example on the manual page for ucwords. How hard did you look?
Edward
--
Chris Boget wrote:
I would like to write a filter that
takes the text "smith" or "SMith" and
returns "Smith"; same for "ralph smith".
Is the a good source on using filters
this way?
It may not be the most efficient way of accomplishing this, but you
could do something like:
$string = 'SMit
Todd Cary wrote:
> I would like to write a filter that takes the text "smith" or "SMith"
> and returns "Smith"; same for "ralph smith". Is the a good source on
> using filters this way?
// filter?
echo ucfirst(strtolower("SMith"));
// or
echo ucwords(strtolower("ralph a. SMith"));
// with reg
> I would like to write a filter that
> takes the text "smith" or "SMith" and
> returns "Smith"; same for "ralph smith".
> Is the a good source on using filters
> this way?
It may not be the most efficient way of accomplishing this, but you
could do something like:
$string = 'SMith'
$fixedSt
Todd Cary wrote:
I would like to write a filter that takes the text "smith" or "SMith"
and returns "Smith"; same for "ralph smith". Is the a good source on
using filters this way?
Thank you...
You're welcome.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit
ucwords(strtolower($string))
or
ucfirst(strtolower($string))
On 3/13/07, Todd Cary <[EMAIL PROTECTED]> wrote:
I would like to write a filter that takes the text "smith" or
"SMith" and returns "Smith"; same for "ralph smith". Is the a
good source on using filters this way?
Thank you...
--
P
I would like to write a filter that takes the text "smith" or
"SMith" and returns "Smith"; same for "ralph smith". Is the a
good source on using filters this way?
Thank you...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
13 matches
Mail list logo