BNAME.RU » Блоги » Программирование » PHP » PHP преобразовать первый символ в верхний регистр - функция mb_ucfirst() в многобайтных кодировках и юникода

PHP преобразовать первый символ в верхний регистр - функция mb_ucfirst() в многобайтных кодировках и юникода

Многие замечали что стандартная функция ucfirst() преобразует строки с кириллическими русскими символами некорректно.
Как перевести первую букву в верхний регистр многобайтных кодировках?
Аналог PHP функции ucfirst. Работает многобайтными кодировками ( UTF-8 использует по умолчанию ).

function mb_ucfirst($string, $charset = 'UTF-8') {
    return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset) . 
    mb_substr($string, 1, mb_strlen($string, $charset), $charset);
}

Вызвать очень просто:

$string = 'слово';
echo mb_ucfirst($string,'UTF-8'); //Можно не задавать кодировку, по умолчанию UTF-8

Вернет строковое значение $string - где первый символ будет произведен в верхний регистр, в нужной вам кодировке.
Есть аналогичная функция ​mb_lcfirst()​​​
Спасибо за внимание!
PHP

Комментарии (359)

Hi, I do believe this is an excellent web site. I stumbledupon it ;) I'm going to revisit once again since I bookmarked it. Money and freedom is the best way to change, may you be rich and continue to guide others. https://hotxxxmilf.pro/en/Goth/ https://hotxxxmilf.pro/en/Outdoor/ hotxxxmilf.pro https://hotxxxmilf.pro/en/Bath/ https://hotxxxmilf.pro/en/Pissing/ https://hotxxxmilf.pro/en/Asian/ hotxxxmilf.pro https://hotxxxmilf.pro/en/Milf/

Wow that was unusual. I just wrote an extremely long comment but after I clicked submit my comment didn't appear. Grrrr... well I'm not writing all that over again. Anyway, just wanted to say fantastic blog! how milf pussy licking sex http://funfest.org/__media__/js/netsoltrademark.php?d=biboxs.com%2F%3Fp%3Dposty
ourexgirls https://cutt.ly/OUotSbk https://bname.ru/blogi/programmirovanie/php/15-php-preobrazovat-pervyj-simvol-v
-verhnij-registr-funkcija-mb_ucfirst-v-mnogobajtnyh-kodirovkah-i-kirillice.html

kredyt inwestycyjny wspolfinansowany ze srodkow ebi - http://www.drugoffice.gov.hk/gb/unigb/www.click4r.com/posts/g/5174314/duand-380
-e-poand-380-yczki-pozabankowe-bez-zdolnoand-347-ci-kredytowej Thanks for another magnificent article. The place else could anybody get that type of information in such an ideal manner of writing? I've a presentation next week, and I'm at the look for such information. mbank kredyt hipoteczny placowki

Интересная тема - http://1winzerkalo.kiev.ua/ ! Вижу что не только меня это волнует. У вас отличный блог. Кто даст личную консультацию? отзовитесь, готов перейти в личку. Еще раз спасибо за статью! Я редактор спортивной газеты и автор. Часто пишу статьи на разные темы - онлайн казино на реальные деньги. Любимые игровые темы - от 1вин. Мои коллеги по цеху с удовольствием обсудят новость.|Мы с друзьями обязательно обсудим поподробней. Простите за ошибки в комментарии! Пишу быстро =)

Internet dating can bee qute a exciting and fun way to met new people and start a fdesh romantic relationship. Even so, it could also be a little mind-boggling, especially when you're uncertain where to start. https://usa.life/read-blog/32600 https://usa.life/read-blog/32600 https://usa.life/read-blog/32600

Courting can be quite a exciting and fun approach to meet new people and commence a new romantic relationship. Nevertheless, it can also be somewhat overwhelming, particularly when you're not sure where to begin. https://twitback.com/post/206688 https://twitback.com/post/206688 https://twitback.com/post/206688

Courting could be a exciting and fun approach to make new friends and begin a freh connection. Nonetheless, it is also a bit overpowering, particularly when you're uncler where to begin. https://www.deviantart.com/lily6barnes/art/iStock-000032105578Small-933021100 https://www.deviantart.com/lily6barnes/art/iStock-000032105578Small-933021100 https://www.deviantart.com/lily6barnes/art/iStock-000032105578Small-933021100

Online dating can be a exciting and fun approach to make new friends and commence a braqnd new partnership. Nonetheless, it is also a lttle bit mind-boggling, especially when you're uncertain how to begin. https://palscity.com/post/886747_how-to-get-the-most-out-of-your-dates-at-schoo
l-as-a-student-you-039-re-likely-b.html https://palscity.com/post/886747_how-to-get-the-most-out-of-your-dates-at-schoo
l-as-a-student-you-039-re-likely-b.html https://palscity.com/post/886747_how-to-get-the-most-out-of-your-dates-at-schoo
l-as-a-student-you-039-re-likely-b.html

magnificent post, very informative. I wonder why the other experts of this sector don't notice this. You should continue your writing. I am confident, you have a great readers' base already! https://kausorecord.com/4058-2/

I'm impressed, I must say. Seldom do I encounter a blog that's both educative and amusing, and without a doubt, you've hit the nail on the head. The issue is something that too few people are speaking intelligently about. Now i'm very happy that I came across this during my hunt for something concerning this. https://cristianyyhqq.blogdun.com/16783583/a-simple-key-for-reward-slot-99-unve
iled

I really love your blog.. Pleasant colors & theme. Did you build this web site yourself? Please reply back as I'm trying to create my own website and would love to find out where you got this from or just what the theme is called. Appreciate it! https://www.tumblr.com/g2g1bet

http://collinnqvk630.jigsy.com/entries/general/green-house-delivery-trendy-and-
trusted-place-to-order-cannabis-in-langley

Does your website have a contact page? I'm having problems locating it but, I'd like to shoot you an e-mail. I've got some creative ideas for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it grow over time. https://rupshikarai.co.in/candy-stars/

Sports betting. Bonus to the first deposit up to 500 euros. online casino

Online datting might be a exciting and fun meethod to meet new people annd begjn a new connection. Nonetheless, it could also be a little frustrating, particularly when you're not sure where to start. https://www.deviantart.com/lily6barnes/art/iStock-000032105578Small-933021100 https://www.deviantart.com/lily6barnes/art/iStock-000032105578Small-933021100 https://www.deviantart.com/lily6barnes/art/iStock-000032105578Small-933021100

Internet dating can be quite a fun and exciting waay to meet new people and start a whole new connection. However, it may also be somewhat overwhelming, especially when you're unsure where to begin. https://Twitback.com/post/206688 https://Twitback.com/post/206688 https://Twitback.com/post/206688

Качественное http://primtorg.ru/?goto=http://www.aiki-evolution.jp/yy-board/yybbs.cgi%3Flist
=thread по доступным ценам в России

Капперы в телеграмм https://similars.net/alternatives-to/apebet.ru

Situs update pragmaticseo terpercaya membagikan informasi terbaru tentang dunia iGaming.

Situs update mobile legends terpercaya membagikan informasi terbaru tentang dunia iGaming.

Situs trik pubg terpercaya membagikan informasi terbaru tentang dunia iGaming.

bestspherepictures.blogspot.com It's a shame you don't have a donate button! I'd without a doubt donate to this brilliant blog! I suppose for now i'll settle for book-marking and adding your RSS feed to my Google account. I look forward to brand new updates and will share this website with my Facebook group. Chat soon!

Are you looking to jumpstart your career in the exciting world of Web3 and blockchain technology? Look no further than TopWeb3Jobs.com! Our website is dedicated to connecting top talent with innovative companies at the forefront of this rapidly growing industry. Whether you're a seasoned pro or just starting out, you'll find a wealth of opportunities to advance your career and shape the future of work on the blockchain. Visit us today and discover the many ways you can make a real impact in this dynamic and rapidly evolving field! crypto jobs london

Are you looking to jumpstart your career in the exciting world of Web3 and blockchain technology? Look no further than TopWeb3Jobs.com! Our website is dedicated to connecting top talent with innovative companies at the forefront of this rapidly growing industry. Whether you're a seasoned pro or just starting out, you'll find a wealth of opportunities to advance your career and shape the future of work on the blockchain. Visit us today and discover the many ways you can make a real impact in this dynamic and rapidly evolving field! crypto Jobs Remote europe

toto slot (archive.ams.cmu.ac.th)

Are you looking to jumpstart your career in the exciting world of Web3 and blockchain technology? Look no further than TopWeb3Jobs.com! Our website is dedicated to connecting top talent with innovative companies at the forefront of this rapidly growing industry. Whether you're a seasoned pro or just starting out, you'll find a wealth of opportunities to advance your career and shape the future of work on the blockchain. Visit us today and discover the many ways you can make a real impact in this dynamic and rapidly evolving field! crypto jobs in switzerland

Are you looking to jumpstart your career in the exciting world of Web3 and blockchain technology? Look no further than TopWeb3Jobs.com! Our website is dedicated to connecting top talent with innovative companies at the forefront of this rapidly growing industry. Whether you're a seasoned pro or just starting out, you'll find a wealth of opportunities to advance your career and shape the future of work on the blockchain. Visit us today and discover the many ways you can make a real impact in this dynamic and rapidly evolving field! who accepts cryptocurrency in canada

Are you looking to jumpstart your career in the exciting world of Web3 and blockchain technology? Look no further than TopWeb3Jobs.com! Our website is dedicated to connecting top talent with innovative companies at the forefront of this rapidly growing industry. Whether you're a seasoned pro or just starting out, you'll find a wealth of opportunities to advance your career and shape the future of work on the blockchain. Visit us today and discover the many ways you can make a real impact in this dynamic and rapidly evolving field! crypto jobs houston tx

Are you looking to jumpstart your career in the exciting world of Web3 and blockchain technology? Look no further than TopWeb3Jobs.com! Our website is dedicated to connecting top talent with innovative companies at the forefront of this rapidly growing industry. Whether you're a seasoned pro or just starting out, you'll find a wealth of opportunities to advance your career and shape the future of work on the blockchain. Visit us today and discover the many ways you can make a real impact in this dynamic and rapidly evolving field! how to get crypto jobs

CBD Oil Malta, trustedrevie.ws, Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what youre talking about, why waste your intelligence on just posting videos to your site when you could be giving us something enlightening to read?

Hello, after reading this amazing paragraph i am also glad to share my familiarity here with mates. @Reuters: Small businesses have failed to cash in on election paraphernalia in Nigeria as social media has been a key campaigning tool ahead of the February 25 vote in the country https://t.co/imffCzBdyT https://t.co/GahvuhuiTn (https://businesscable.com.ng)

https://unsplash.com

Недорогой ремонт инструментов в Минске http://mirhimii.ru/index.php?subaction=userinfo&user=ininug

Excellent way of explaining, and pleasant article to obtain facts concerning my presentation focus, which i am going to deliver in school. Nigeria (earlybaze.com.ng)

I have read several good stuff here. Certainly worth bookmarking for revisiting. I surprise how so much attempt you set to make one of these fantastic informative site. Christian Business Directory (afribaze.com.ng)

It's a pity you don't have a donate button! I'd certainly donate to this superb blog! I suppose for now i'll settle for book-marking and adding your RSS feed to my Google account. I look forward to fresh updates and will talk about this website with my Facebook group. Chat soon! [Business] - Experts enumerate impediments to doing business in Nigeria, topfinders.com.ng,

Оставить комментарий

Кликните на изображение чтобы обновить код, если он неразборчив
Последние комментарии
Thurman - 25 октября 2023 02:48
PHP преобразовать первый символ в верхний регистр - функция mb_ucfirst() в многобайтных кодировках и юникода

denver chriopractor Excellent blog here! Also your web site loads up fast! What web host are you using? Can I get your

Darrel - 21 октября 2023 06:03
PHP преобразовать первый символ в верхний регистр - функция mb_ucfirst() в многобайтных кодировках и юникода

It is because with the help of on-line booking system you'll receive an e-mail notification as a reminder of your

Brendan - 8 октября 2023 23:54
PHP преобразовать первый символ в верхний регистр - функция mb_ucfirst() в многобайтных кодировках и юникода

Interactive prime and composite numbers games for 4th graders such as these will help them achieve an actual-time

Twila - 6 октября 2023 12:51
PHP преобразовать первый символ в верхний регистр - функция mb_ucfirst() в многобайтных кодировках и юникода

poker gacor 2023 I visited many blogs but the audio feature for audio songs present at this web site is really

Frieda - 5 октября 2023 18:53
PHP преобразовать первый символ в верхний регистр - функция mb_ucfirst() в многобайтных кодировках и юникода

situs slot gacor malam ini Keep on writing, great job!

Онлайн статистика
6 посетителей на сайте. Из них:
Гости5
Роботы1