/    Sign up×
Community /Pin to ProfileBookmark

?
I have this code in which it gets name from database, and is display as a greeting to them on site, I want to be able to have the first letter of name be uppercase. where or how would I add this code to accomplish this

ucfirst

<?php echo $row_getName[‘first_name’]; ?>

Thx for your help

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiOct 22.2009 — [code=php]<?php echo ucfirst($row_getName['first_name']) ?>[/code]
Copy linkTweet thisAlerts:
@RJwebauthorOct 22.2009 — Thx, you did that faster than it took me to write out question, I tried something like that but I think I forgot the closing ), thx again
Copy linkTweet thisAlerts:
@RJwebauthorOct 22.2009 — ?

Just another question, I also have team_name, which is usually more than 1 word, but if I use the same code there it will only upcase the first letter on first word, is there any way of ammending this, thx

<?php echo ucfirst($row_getName['team_name']); ?>
Copy linkTweet thisAlerts:
@ssystemsOct 22.2009 — split the value and ucfirst each item.
Copy linkTweet thisAlerts:
@RJwebauthorOct 22.2009 — ?

wouldn't that affect the db entry or recordset? How would I go about that? Thx
Copy linkTweet thisAlerts:
@NogDogOct 22.2009 — [url=http://php.net/ucwords]ucwords[/url]()
×

Success!

Help @RJweb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...