Voting

: max(six, eight)?
(Example: nine)

The Note You're Voting On

qeremy [atta] gmail [dotta] com
13 years ago
An alternative for unicode strings;

<?php
function chunk_split_unicode($str, $l = 76, $e = "\r\n") {
$tmp = array_chunk(
preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY), $l);
$str = "";
foreach (
$tmp as $t) {
$str .= join("", $t) . $e;
}
return
$str;
}

$str = "Yarım kilo çay, yarım kilo şeker";
echo
chunk_split($str, 4) ."\n";
echo
chunk_split_unicode($str, 4);
?>

Yar�
�m k
ilo
çay
, ya
rım
kil
o ş
eker

Yarı
m ki
lo ç
ay,
yarı
m ki
lo ş
eker

<< Back to user notes page

To Top