PHP birden fazla satır sonu \ n algılamak nasıl?

0 Cevap

Birden fazla \n tespit etmek gerekir. 2 ya da 1000 ise sürece birden fazla \n olduğu gibi, fark etmez. (Regex yani gerekli ise) Bu ne için regex olurdu?

EDIT

Ben kullanıyorum:

$pregmatch = preg_match('#\\n\\n+#', $locations);
if ($pregmatch > 0) {
    echo 'more than one, this many: '.count($pregmatch);
} else
        echo 'less than one';

ama count($pregmatch) birden fazla gerçek sayısını döndürmüyor \n algılandı. Bu nasıl sağlanabilir?

0 Cevap