summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests/013.inc
blob: 97da70c7dc2befe81cbe6e2d9558ecb7cefaaf04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
// TODO: Add more encodings
ini_set('include_path','.');
include_once('common.inc');

// EUC-JP
$euc_jp = '0123この文字列は日本語です。EUC-JPを使っています。日本語は面倒臭い。';

print  mb_strcut($euc_jp,  6,   5,'EUC-JP') . "\n";
print  mb_strcut($euc_jp,  0, 100,'EUC-JP') . "\n";

$str = mb_strcut($euc_jp, 100, 10,'EUC-JP');
($str === "") ? print "OK\n" : print "NG: $str\n";

$str = mb_strcut($euc_jp, -100, 10,'EUC-JP');
($str !== "") ?	print "OK: $str\n" : print "NG:\n";


?>