Jump to content


Photo

Using strotupper() not working?


  • Please log in to reply
3 replies to this topic

#1 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 22 October 2006 - 08:27 AM

I was hoping someone could help me out with this, it is pretty self-explanatory.

$sentence = "i wanna make the beginning letter capital only.";
 
 // $words is now an array
 $words = explode(" ", $sentence);
 
 foreach ($words as $word)
 	{
		$word = strtoupper(substr($word, 1, 1));
		echo $word;
	}

This outputs:
AAHEEAN

Thanks for any help you can give.

#2 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 22 October 2006 - 08:29 AM

ucfirst

#3 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 22 October 2006 - 08:44 AM

Pardon?

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,022 posts

Posted 22 October 2006 - 08:48 AM

It's a php function

http://www.php.net/ucfirst
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users