<!-- before directive -->
<input type="text" name="name" value="0" rt-number />
<!-- after directive -->
<input type="text" name="name" value="0" rt-number>
<div class="wrap" ng-transclude></div>
</input>
function same_chars($first, $second)
{
$len = min(strlen($first), strlen($second));
$matched = 0;
for ($i = 0; $i < $len; ++$i) {
if ($first[$i] === $second[$i]) {
++$matched;
} else {
break;
}
}
return $matched;
}
var_dump(same_chars('9089102110', '90856')); // 3