Hi!
I'll try to convert field first char to upper by using ucwords(). Well,
this doesn't
seem to work correct.
Well maybe error came, because that characteres are not standard (they
are special characterers, finnish language).
Example:
$work_text = perhepäivähoitaja;
$work_text = ucwords
To: [EMAIL PROTECTED]
Subject: [PHP] ucwords()?
Hi!
I'll try to convert field first char to upper by using ucwords(). Well,
this doesn't
seem to work correct.
Well maybe error came, because that characteres are not standard (they
are special characterers, finnish language).
Example:
$work_text
PROTECTED]]
Sent: 11. syyskuuta 2002 17:14
To: [EMAIL PROTECTED]
Subject: [PHP] ucwords()?
Hi!
I'll try to convert field first char to upper by using ucwords(). Well,
this doesn't
seem to work correct.
Well maybe error came, because that characteres are not standard (they
are special
Hi All,
I am trying to figure out how to use ucwords here :
if (submit)
$db = mysql_connect($dbhost,$dbuname,$dbpass);
mysql_select_db($dbname,$db);
ucwords($sql)Is this correct ?
$sql = INSERT INTO $prefix;
$sql .= (first, last, email, company,
Looks like it, but you're missing the semi-colon at the end of the line.
-Original Message-
From: Daniel Negron/KBE [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ucwords() usage QUICKIE
Hi All,
I am trying to figure
DNK I am trying to figure out how to use ucwords here :
DNK if (submit)
DNK $db = mysql_connect($dbhost,$dbuname,$dbpass);
DNK mysql_select_db($dbname,$db);
DNK ucwords($sql)Is this correct ?
DNK $sql = INSERT INTO $prefix;
DNK $sql .= (first,
]
To: [EMAIL PROTECTED]
Sent: Friday, June 14, 2002 5:06 PM
Subject: [PHP] ucwords() usage QUICKIE
Hi All,
I am trying to figure out how to use ucwords here :
if (submit)
$db = mysql_connect($dbhost,$dbuname,$dbpass);
mysql_select_db($dbname,$db);
ucwords($sql
I came up with a function to to that last month; see the PHP archives:
http://marc.theaimsgroup.com/?l=php-generalm=99778991424637w=2
-steve
At 11:20 PM -0400 9/23/01, Jack Dempsey wrote:
i could roll my own, and for now will just use a str_replace after ucwords,
but would it be
i could roll my own, and for now will just use a str_replace after ucwords,
but would it be possible to add an optional parameter to ucwords which would
be an array of words to skip? i would think this would be useful to
many.
any thoughts?
--
PHP General Mailing List
I know, I know, I have a lot of work to do...I shouldn't be doing
this. I did get to play with PCRE regexps here, though...lotsa cool
features over eregs!. Anyway, here's a *** NEW!!! IMPROVED!!! ***
version of smart_ucwords(), that's probably way too much overkill. I
did some quick tests,
Is there a prewritten function for capitalizing the first letter of each
word in a string except for the common words you wouldn't want
to capitalize in a title? Like
Come Learn the Facts From an Industry Leader
Thanks.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To
Is there a prewritten function for capitalizing the first
letter of each word in a string except for the common
words you wouldn't want to capitalize in a title? Like
Come Learn the Facts From an Industry Leader
None that I've seen.
But it wouldn't be hard to write a function that takes a
http://www.php.net/manual/en/function.ucwords.php
You can read all about the limit of this function, but this is the closest
thing to what you're looking for.
Rick
Is there a prewritten function for capitalizing the first letter of each
word in a string except for the common words you
Something like this, perhaps (untested):
function smart_ucwords($String)
{
$ExceptionList = array('the', 'an', 'a'); # should all be in lowercase
$String = ucwords(strtolower(ltrim($String))); # LINE A
foreach ($ExceptionList as $Word)
{
$String =
Something like this, perhaps (untested):
I needed this too so I just tested it.
function smart_ucwords($String)
{
$ExceptionList = array('the', 'an', 'a'); # should all be in
lowercase
$String = ucwords(strtolower(ltrim($String))); # LINE A
foreach ($ExceptionList as
Fabulous. Thanks to Steve and Mark. Exactly what I needed.
Jeff Oien
Something like this, perhaps (untested):
I needed this too so I just tested it.
function smart_ucwords($String)
{
$ExceptionList = array('the', 'an', 'a'); # should all be in
lowercase
$String =
16 matches
Mail list logo