⊗ppPmSFSp 153 of 447 menu

String Splitting in PHP

explode implode str_split mb_split mb_str_split chunk_split

Given a string:

<?php $str = 'aaa bbb ccc'; ?>

Write each word of this string into a separate array element.

Given an array:

<?php $arr = ['a', 'b', 'c', 'd', 'e']; ?>

Merge the elements of this array into a string so that they are separated by commas.

Given a string:

<?php $str = '1234567890'; ?>

Split it into the following array:

['12', '34', '56', '78', '90']

Given a string:

<?php $str = '1234567890'; ?>

Split it into the following array:

['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']

Given a string:

<?php $str = '1234567890'; ?>

Make the following string from it without using a loop:

'12-34-56-78-90'

The variable $date contains a date in the format year-month-day. Convert this date to the format day.month.year.

Given a string:

<?php $str = 'word※word※word※word'; ?>

Split the string by the character '※' using mb_split.

Given a string:

<?php $str = 'программирование'; ?>

Split the string into an array of characters using mb_str_split.

Given a string:

<?php $str = 'кириллица'; ?>

Split the string into an array of characters using mb_str_split, specifying a fragment length of 2 characters.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline