1--TEST--
2Test mb_substr_count() function : basic functionality
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7/*
8 * Test Basic functionality of mb_substr_count
9 */
10
11echo "*** Testing mb_substr_count() : basic functionality ***\n";
12
13$string_ascii = 'This is an English string. 0123456789.';
14
15$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
16$needle_mb1 = base64_decode('44CC');
17$needle_mb2 = base64_decode('44GT44KT44Gr44Gh44Gv44CB5LiW55WM');
18
19echo "\n-- ASCII String --\n";
20var_dump(mb_substr_count($string_ascii, 'is'));
21var_dump(mb_substr_count($string_ascii, 'hello, world'));
22
23echo "\n-- Multibyte String --\n";
24var_dump(mb_substr_count($string_mb, $needle_mb1));
25var_dump(mb_substr_count($string_mb, $needle_mb2));
26
27echo "Done";
28?>
29--EXPECT--
30*** Testing mb_substr_count() : basic functionality ***
31
32-- ASCII String --
33int(3)
34int(0)
35
36-- Multibyte String --
37int(2)
38int(0)
39Done
40