//インスタンスの生成
$obj = new FuncRecursive()
----------------------------------------------------------------------------------------------------------------------
//strlen
$a = array('test', array('aaabbb"&&"αβ', 'hello world'));
$r = $obj->execute('strlen', $a);
//実行結果
Array
(
[0] => 4
[1] => Array
(
[0] => 14
[1] => 11
)
)
----------------------------------------------------------------------------------------------------------------------
//strip_tags
$a = array('<h1>test</h1>', array('aaabbb"&&"αβ', '<a>hello world</a>'));
$r = $obj->execute('strip_tags', $a);
//実行結果
Array
(
[0] => test
[1] => Array
(
[0] => aaabbb"&&"αβ
[1] => hello world
)
)
----------------------------------------------------------------------------------------------------------------------
//htmlentities
$a = array('<h1>test</h1>', array('aaabbb"&&"αβ', '<a>hello world</a>'));
$r = $obj->execute('htmlentities', $a);
//実行結果
Array
(
[0] => <h1>test</h1>
[1] => Array
(
[0] => aaabbb"&&"αβ
[1] => <a>hello world</a>
)
)
----------------------------------------------------------------------------------------------------------------------
//htmlspecialchars
$a = array('<h1>test</h1>', array('aaabbb"&&"αβ', '<a>hello world</a>'));
$r = $obj->execute('htmlspecialchars', $a);
//実行結果
Array
(
[0] => <h1>test</h1>
[1] => Array
(
[0] => aaabbb"&&"αβ
[1] => <a>hello world</a>
)
)
----------------------------------------------------------------------------------------------------------------------
//mb_convert_kana
$a = array('アイウエオ','ガギグゲゴ',array('パピプペポ','フライドポテト', array('ヴァヴァヴァ')));
$r = $obj->execute('mb_convert_kana', $a, 'KV', 'UTF-8');
//実行結果
Array
(
[0] => アイウエオ
[1] => ガギグゲゴ
[2] => Array
(
[0] => パピプペポ
[1] => フライドポテト
[2] => Array
(
[0] => ヴァヴァヴァ
)
)
)
----------------------------------------------------------------------------------------------------------------------
//sampleFunc(自作の関数)
function sampleFunc($data) {
echo $data.'<br />';
}
$a = array('あいうえお','かきくけこ',array('食べられません', '冷やし中華始めませんか?'));
$r = $obj->execute('sampleFunc', $a);
//実行結果
あいうえお
かきくけこ
食べられません
冷やし中華始めませんか?
----------------------------------------------------------------------------------------------------------------------
//implode
$obj->type = 'array';
$a = array('あいうえお','かきくけこ',array('食べられません', '冷やし中華始めませんか?'));
$r = $obj->execute('implode', $a, ',');
//実行結果
あいうえお,かきくけこ,食べられません,冷やし中華始めませんか?
----------------------------------------------------------------------------------------------------------------------
//strpos
$a = array('test.html', array('sample.mp4', 'norm-nois.com'));
$r = $obj->execute('strpos', $a, '.');
//実行結果
Array
(
[0] => 4
[1] => Array
(
[0] => 6
[1] => 9
)
)
----------------------------------------------------------------------------------------------------------------------
//タイプmapを使ったsubstr
$a = array('test.html', array('a' => 'sample.mp4', 'b' => 'norm-nois.com', array('abced.jp', 'test.png')), 'abc.com');
$b = $obj->execute('strrpos', $a, '.');
$obj->type = 'map';
$r = $obj->execute('substr', $a, $b);
//実行結果
Array
(
[0] => .html
[1] => Array
(
[a] => .mp4
[b] => .com
[0] => Array
(
[0] => .jp
[1] => .png
)
)
[2] => .com
)