- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
// 前半が半角、後半が全角
$str = 'ABC123|ABC123';
if (preg_match_all('/\d+/', $str, $matches)) {
var_dump($matches);
}
if (preg_match_all('/\d+/u', $str, $matches)) {
var_dump($matches);
}