arkadaşlar teşekkurler sorun if döngüsünden önce vermiş oldugum echo danmış.

echo '>>>'.$kontrol.'<<<<';