PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $text = 'na'; $text = preg_replace('/[^ablon]/g','',$text); $arr = str_split($text); $counter = array_count_values($arr); $counter['a'] = $counter['a'] ?? 0; $counter['b'] = $counter['b'] ?? 0; $counter['l'] = floor($counter['l']*0.5) ?? 0; $counter['o'] = floor($counter['o']*0.5) ?? 0; $counter['n'] = $counter['n'] ?? 0; print_r($counter); print_r(min($counter));
Show:  
Copy Clear