- var_dump: documentation ( source)
- sscanf: documentation ( source)
<?php
$str = "In My Cart : 11 items";
list($count) = sscanf($str, 'In My Cart : %s items');
var_dump($count);
echo "\n";
list($count) = sscanf($str, 'In My Cart : %d items');
var_dump($count);