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 this is one of
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. :-)
You *think* you
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 than it
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
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...
--
PHP
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?
?php
$txt = ralph SMith;
$txt = ucwords(strtolower($txt));
?
Thank you...
You're welcome.
-Stut
--
PHP
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'
$fixedString =
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 regard 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
--
PHP General
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
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 = 'SMith'
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
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 with
13 matches
Mail list logo