RSS   Twitter   Copiny   Copiny
Нашел ошибку? 

Выдели фрагмент текста с ошибкой или неточностью и нажми Ctrl+Enter!

JString - работа со строками

Для того чтобы Joomla! в полной мере поддерживать многоязычные требования, Joomla! использует кодировку Unicode или UTF-8. Unicode - это набор символов, включающий все известные языки. 
В Joomla нам предоставляется статический класс JString. Он позволяет нам выполнять большинство из обычных строковых функций только в кодировке UTF-8.

$string = JString::strtoupper($string);

Этот пример показывает, как мы можем использовать JString, чтобы преобразовать строку в верхний регистр. Заметим, что имя метода совпадает с аналогичной php-функцией:

PHP функция JString метод Описание
strpos strpos Находит первое совпадение строки в строке
substr substr Возвращает часть строки
strtolower strtolower Возвращает строку в нижнем регистре
strtoupper strtoupper Возвращает строку в верхнем регистре
strlen strlen Количество символов в строке
str_ireplace str_ireplace Возвращает строку, в которой все вхождения search (без учета регистра символов) заменены на replace
str_split str_split Разбивает строку в массив по заданному символу
strcasecmp strcasecmp Сравнивает строки
strcspn strcspn Возвращает длину участка в начале строки, не соответствующего маске
stristr stristr Находит первое совпадение строки в строке (нечуствительно к регистру)
strrev strrev Переворачивает строку задом наперед
strspn strspn Находит самый длинный сегмент строки заключенный в заданные символы
substr_replace substr_replace Производит замену символов в строке
ltrim ltrim Удаляет пробелы с левой части строки
rtrim rtrim Удаляет пробелы с правой части строки
trim trim Удаляет пробелы слева и справа
ucfirst ucfirst Переводит первый символ в верхний регистр
ucwords ucwords Переводит первый символ каждого слова в верхний регистр.
  transcode Переводит строку из одной кодировки в другую. Требует iconv

Определяется класс в файле

libraries/joomla/utilities/string.php

Подключение JString

jimport( 'joomla.utilities.string' );

Смотрите также:
Комментарии (67) Добавить комментарий
  • Tad
    Tad
    17 Декабря 2011, 19:31
     ↑  +6  ↓     ответ

    А зачем он нужен, если можно пользоваться native PHP? Не пойму...

    • Pavlik
      Pavlik
      02 Октября 2012, 06:19
       ↑  +1  ↓     ответ

      Хочется услышать ответ (хотя бы варианты)

      Неужели целый клас просто так засунили в цмс.

  • Alf
    Alf
    09 Апреля 2013, 00:49
     ↑  +1  ↓     ответ

    Насколько я понимаю - для того, чтобы корректно работали те функции, которые некорректно рабтают с UTF-8, те же ucfirst и ucwords

  • tinyurl.com
    tinyurl.com
    23 Ноября 2019, 22:57
     ↑  0  ↓     ответ

    Thanks a lot for sharing this with all folks you really

    know what you are talking approximately! Bookmarked. Please additionally visit

    my website =). We can have a hyperlink change contract

    among us

  • http://tinyurl.com/sh7uarv
    http://tinyurl.com/sh7uarv
    25 Ноября 2019, 07:34
     ↑  0  ↓     ответ

    I pay a quick visit day-to-day a few web sites and information sites to read posts, except this website offers quality based

    writing.

  • where coconut oil
    where coconut oil
    26 Ноября 2019, 03:42
     ↑  0  ↓     ответ

    I all the time emailed this web site post page to all my

    associates, since if like to read it then my friends will too.

  • plenty of fish dating site
    plenty of fish dating site
    26 Ноября 2019, 22:30
     ↑  0  ↓     ответ

    A motivating discussion is definitely worth comment.

    I think that you should publish more about this subject matter,

    it may not be a taboo subject but typically people do not speak about these topics.

    To the next! Cheers!!

  • ps4 games
    ps4 games
    29 Ноября 2019, 11:06
     ↑  0  ↓     ответ

    Hi, i feel that i saw you visited my weblog thus i came to return the prefer?.I'm attempting

    to find issues to improve my site!I guess its adequate

    to make use of some of your ideas!!

  • quest bars cheap
    quest bars cheap
    30 Ноября 2019, 15:30
     ↑  0  ↓     ответ

    I was very pleased to uncover this great site. I want to to

    thank you for ones time for this particularly fantastic read!!

    I definitely liked every bit of it and I have you saved to

    fav to look at new stuff on your blog.

  • quest bars cheap
    quest bars cheap
    02 Декабря 2019, 03:02
     ↑  0  ↓     ответ

    Generally I do not read article on blogs,

    however I would like to say that this write-up very forced me to try and do

    it! Your writing style has been amazed me.

    Thank you, very nice article.

  • quest bars cheap
    quest bars cheap
    02 Декабря 2019, 16:31
     ↑  0  ↓     ответ

    Its not my first time to go to see this web page, i am

    browsing this site dailly and obtain good facts from

    here every day.

  • quest bars cheap coupon twitter
    quest bars cheap coupon twitter
    03 Декабря 2019, 05:14
     ↑  0  ↓     ответ

    Hi there, I found your web site by means of Google while looking for

    a similar subject, your web site got here up, it appears to be like great.

    I have bookmarked it in my google bookmarks.

    Hello there, just was aware of your weblog through Google, and located that it is truly informative.

    I'm going to be careful for brussels. I'll be grateful in the event you proceed this

    in future. A lot of other people will be benefited from

    your writing. Cheers!

  • quest bars cheap coupon twitter
    quest bars cheap coupon twitter
    04 Декабря 2019, 05:10
     ↑  0  ↓     ответ

    Wow, this post is nice, my younger sister is analyzing

    these kinds of things, thus I am going to tell her.

  • quest bars cheap
    quest bars cheap
    04 Декабря 2019, 07:41
     ↑  0  ↓     ответ

    It's wonderful that you are getting thoughts from this

    post as well as from our discussion made here.

  • ps4 games
    ps4 games
    05 Декабря 2019, 14:30
     ↑  0  ↓     ответ

    Greetings! Very useful advice in this particular post!

    It's the little changes that produce the most important changes.

    Many thanks for sharing!

  • ps4 games
    ps4 games
    06 Декабря 2019, 02:54
     ↑  0  ↓     ответ

    Hi there! I could have sworn I've been to this website before but after reading through some of the post I realized it's new to me.

    Nonetheless, I'm definitely glad I found it and I'll be book-marking and checking back frequently!

  • ps4 games
    ps4 games
    06 Декабря 2019, 11:42
     ↑  0  ↓     ответ

    Why viewers still make use of to read news papers when in this technological globe all is existing on web?

  • ps4 games
    ps4 games
    06 Декабря 2019, 16:27
     ↑  0  ↓     ответ

    I am not certain where you are getting your

    information, however great topic. I must spend some time learning more or

    understanding more. Thanks for magnificent info I was on the

    lookout for this info for my mission.

  • ps4 games
    ps4 games
    06 Декабря 2019, 19:43
     ↑  0  ↓     ответ

    Hello there, You have done a fantastic job. I'll definitely digg it and personally suggest to my friends.

    I am sure they will be benefited from this site.

  • quest bars cheap
    quest bars cheap
    07 Декабря 2019, 17:52
     ↑  0  ↓     ответ

    Quality articles or reviews is the important to interest the viewers to go

    to see the web page, that's what this web site

    is providing.

  • quest bars cheap
    quest bars cheap
    09 Декабря 2019, 06:52
     ↑  0  ↓     ответ

    Hi, this weekend is fastidious in support of me, because this point in time i am reading

    this great informative piece of writing here at my house.

  • quest bars cheap
    quest bars cheap
    10 Декабря 2019, 12:07
     ↑  0  ↓     ответ

    Truly no matter if someone doesn't know after that its up

    to other visitors that they will assist, so here it happens.

  • ps4 games
    ps4 games
    11 Декабря 2019, 00:34
     ↑  0  ↓     ответ

    This site certainly has all the information and facts I needed about this

    subject and didn't know who to ask.

  • ps4 games
    ps4 games
    12 Декабря 2019, 10:07
     ↑  0  ↓     ответ

    Hi there would you mind sharing which blog platform you're using?

    I'm looking to start my own blog soon but I'm having a hard time selecting between BlogEngine/Wordpress/B2evolution and Drupal.

    The reason I ask is because your layout seems different then most blogs and I'm looking for something

    completely unique. P.S Apologies for getting off-topic but I had to

    ask!

  • ps4 games
    ps4 games
    13 Декабря 2019, 15:48
     ↑  0  ↓     ответ

    Hey would you mind letting me know which webhost you're utilizing?

    I've loaded your blog in 3 completely different browsers and I must say this blog loads a lot quicker then most.

    Can you recommend a good web hosting provider at a reasonable price?

    Thanks a lot, I appreciate it!

  • ps4 games
    ps4 games
    14 Декабря 2019, 04:45
     ↑  0  ↓     ответ

    Excellent goods from you, man. I've understand your stuff previous to and you are just too magnificent.

    I really like what you've acquired here, certainly

    like what you are saying and the way in which you say it.

    You make it enjoyable and you still care for to

    keep it wise. I cant wait to read much more from you. This is actually

    a tremendous site.

  • coconut oil
    coconut oil
    15 Декабря 2019, 18:23
     ↑  0  ↓     ответ

    Your style is unique in comparison to other people I have

    read stuff from. Thank you for posting when you've got the opportunity, Guess I will just bookmark this blog.

  • coconut oil
    coconut oil
    17 Декабря 2019, 04:50
     ↑  0  ↓     ответ

    Hi, I do think this is an excellent site. I stumbledupon it ;) I am going to revisit

    yet again since I book-marked it. Money and freedom is the

    best way to change, may you be rich and continue to guide others.

  • coconut oil
    coconut oil
    20 Декабря 2019, 15:09
     ↑  0  ↓     ответ

    Actually when someone doesn't understand after that its up to other viewers that they will assist, so here it takes place.

  • sinnedbeyondhelp
    sinnedbeyondhelp
    28 Декабря 2019, 10:32
     ↑  0  ↓     ответ

    Hello! I just wanted to ask if you ever have any trouble with hackers?

    My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no

    back up. Do you have any methods to protect against hackers?

  • plenty of fish vs match.com free trial
    plenty of fish vs match.com free trial
    30 Декабря 2019, 16:49
     ↑  0  ↓     ответ

    It's genuinely very difficult in this full of activity life

    to listen news on TV, thus I just use the web for that reason, and get the most up-to-date information.

  • match.com free trial
    match.com free trial
    31 Декабря 2019, 01:22
     ↑  0  ↓     ответ

    Link exchange is nothing else but it is only placing

    the other person's website link on your page at proper place and other

    person will also do same in support of you.

  • http://asksylphoflight.tumblr.com
    http://asksylphoflight.tumblr.com
    31 Декабря 2019, 14:39
     ↑  0  ↓     ответ

    obviously like your web site however you have to take a look at the spelling on quite a few of your posts.

    Many of them are rife with spelling issues and I

    find it very troublesome to inform the truth nevertheless I will surely come back again.

  • free trial match.com
    free trial match.com
    01 Января 2020, 09:08
     ↑  0  ↓     ответ

    We are a group of volunteers and opening a new scheme

    in our community. Your web site provided us with valuable information to

    work on. You have done a formidable job and our entire community will

    be thankful to you.

  • sling tv
    sling tv
    01 Января 2020, 16:48
     ↑  0  ↓     ответ

    Hi, i think that i saw you visited my web site thus i

    came to “return the favor”.I'm attempting to find things to enhance my web

    site!I suppose its ok to use some of your ideas!!

  • tinyurl.com
    tinyurl.com
    02 Января 2020, 19:02
     ↑  0  ↓     ответ

    Great beat ! I would like to apprentice even as you amend your web

    site, how could i subscribe for a blog web site? The account helped me a appropriate deal.

    I were a little bit familiar of this your broadcast provided bright clear

    concept

  • sling tv asksylphoflight.tumblr.com
    sling tv asksylphoflight.tumblr.com
    05 Января 2020, 02:44
     ↑  0  ↓     ответ

    Pretty! This has been a really wonderful article.

    Thank you for supplying this info.

  • sling tv
    sling tv
    07 Января 2020, 12:23
     ↑  0  ↓     ответ

    Awesome issues here. I am very happy to peer your article.

    Thank you a lot and I am having a look forward to contact you.

    Will you kindly drop me a e-mail?

  • sling tv
    sling tv
    07 Января 2020, 15:46
     ↑  0  ↓     ответ

    When someone writes an paragraph he/she retains the idea of a user in his/her

    mind that how a user can know it. Therefore that's why this post

    is great. Thanks!

  • sling tv
    sling tv
    14 Января 2020, 13:48
     ↑  0  ↓     ответ

    My brother recommended I might like this website.

    He used to be entirely right. This post truly made my day.

    You can not believe just how so much time I had spent for this

    info! Thanks!

  • sling tv
    sling tv
    14 Января 2020, 20:02
     ↑  0  ↓     ответ

    Attractive component of content. I simply stumbled upon your weblog and in accession capital to assert that I acquire in fact loved account your blog posts.

    Any way I'll be subscribing for your feeds or even I fulfillment you access constantly quickly.

  • sling tv
    sling tv
    15 Января 2020, 19:17
     ↑  0  ↓     ответ

    Great post.

  • sling tv
    sling tv
    17 Января 2020, 07:18
     ↑  0  ↓     ответ

    I always spent my half an hour to read this weblog's content everyday along with

    a cup of coffee.

  • sling tv
    sling tv
    18 Января 2020, 16:56
     ↑  0  ↓     ответ

    Thanks for your marvelous posting! I quite enjoyed reading it, you could be a great

    author. I will remember to bookmark your blog and will

    often come back down the road. I want to encourage you to continue your great

    posts, have a nice weekend!

  • sling tv best package 2020
    sling tv best package 2020
    24 Января 2020, 23:43
     ↑  0  ↓     ответ

    Wow that was strange. I just wrote an very long comment but after I clicked submit my

    comment didn't show up. Grrrr... well I'm not writing all that over again. Anyways, just wanted to say

    great blog!

  • sling tv
    sling tv
    29 Января 2020, 07:33
     ↑  0  ↓     ответ

    You ought to be a part of a contest for one

    of the best websites online. I am going to recommend this

    site!

  • cbd oil that works 2020
    cbd oil that works 2020
    04 Апреля 2020, 15:10
     ↑  0  ↓     ответ

    Hi there, I desire to subscribe for this website to get hottest updates, thus where can i do it please assist.

  • cbd oil that works 2020
    cbd oil that works 2020
    04 Апреля 2020, 17:58
     ↑  0  ↓     ответ

    Thank you a lot for sharing this with all people you really recognize what

    you are talking about! Bookmarked. Kindly additionally discuss with my website =).

    We may have a link change agreement among us

  • ??????
    ??????
    15 Апреля 2020, 16:06
     ↑  0  ↓     ответ

    Great blog here! Also your website loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol

  • g
    g
    16 Июня 2020, 03:15
     ↑  0  ↓     ответ

    I could not refrain from commenting. Very well written!

  • g
    g
    16 Июня 2020, 09:36
     ↑  0  ↓     ответ

    I think the admin of this web site is in fact working hard in favor of his site,

    for the reason that here every stuff is quality based material.

  • g
    g
    17 Июня 2020, 09:38
     ↑  0  ↓     ответ

    Hey there! Would you mind if I share your blog with my facebook group?

    There's a lot of folks that I think would really enjoy

    your content. Please let me know. Cheers

  • g
    g
    17 Июня 2020, 22:31
     ↑  0  ↓     ответ

    What's Taking place i am new to this, I stumbled upon this

    I have found It positively useful and it has helped me

    out loads. I am hoping to contribute & aid other

    customers like its helped me. Good job.

  • online pharmacy
    online pharmacy
    06 Октября 2020, 18:03
     ↑  0  ↓     ответ

    Do you mind if I quote a few of your articles as long as I provide credit

    and sources back to your site? My blog site is in the exact same niche as yours and my users would genuinely benefit from some of the information you present here.

    Please let me know if this okay with you. Regards! online pharmacy https://pharmaciescegs.com/ online

    pharmacy

  • cheap cialis
    cheap cialis
    07 Октября 2020, 23:30
     ↑  0  ↓     ответ

    Cialis cost https://phrcialiled.com/ cialis prices

  • cialis buy
    cialis buy
    09 Октября 2020, 09:37
     ↑  0  ↓     ответ

    Brand cialis https://cialijomen.com cialis without a doctor prescription

  • cialis 5mg
    cialis 5mg
    09 Октября 2020, 10:12
     ↑  0  ↓     ответ

    Pharmacy online https://mycialedst.com cialis 20mg

  • generic cialis
    generic cialis
    10 Октября 2020, 12:53
     ↑  0  ↓     ответ

    Order cialis generic cialis cialis online

  • monthly installment payday loans
    monthly installment payday loans
    13 Октября 2020, 19:11
     ↑  0  ↓     ответ

    Bad credit payday loans https://loans365payday.com instant payday loans

  • best personal loans for bad credit
    best personal loans for bad credit
    13 Октября 2020, 19:34
     ↑  0  ↓     ответ

    Personal loans for veterans https://personal4usloans.com/ second chance personal loans with bad credit

  • viagra without prescription
    viagra without prescription
    15 Октября 2020, 04:38
     ↑  0  ↓     ответ

    Natural viagra for men viagra without prescription viagra pills

  • cialis for sale
    cialis for sale
    16 Октября 2020, 20:45
     ↑  0  ↓     ответ

    Cialis pill cialis for sale cialis pills

  • cost of viagra
    cost of viagra
    20 Октября 2020, 22:59
     ↑  0  ↓     ответ

    Im thinking i may be going through the change

    I carn,t say I have all the signs but I feel blown up

    ,short temper, ichy skin, and some days can just sit and cry.

    cost of viagra Im thinking i may be going through the change I carn,t say I have

    all the signs but I feel blown up ,short temper, ichy skin, and some days can just sit and cry.

  • https://wowviaprice.com/
    https://wowviaprice.com/
    28 Октября 2020, 19:10
     ↑  0  ↓     ответ

    I would use it until it is cleared up and then maybe continue the Vinegar for another week.

    https://wowviaprice.com/ how does viagra work

  • wowviaprice.com
    wowviaprice.com
    28 Октября 2020, 19:55
     ↑  0  ↓     ответ

    At first, respiratory symptoms may be relatively

    mild. wowviaprice.com cost of viagra

  • https://buybuyviamen.com
    https://buybuyviamen.com
    29 Октября 2020, 19:38
     ↑  0  ↓     ответ

    We stock a wide assortment of medical products and are able to special order

    just about anything you might need. how to take viagra ( https://buybuyviamen.com ) i am a woman and i took viagra

  • what exactly does viagra do?
    what exactly does viagra do?
    29 Октября 2020, 20:21
     ↑  0  ↓     ответ

    What are the benefits of the ACTIVE Advantage membership?

    what exactly does viagra do? How to use viagra for best results

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




* обязательно для заполнения

1 введенный почтовый адрес используется только для обратной связи при ответах в комментариях и сервиса gravatar.com
.