If No Characters In Text File

  • Автор темы Автор темы Mulcts
  • Дата начала Дата начала

Mulcts

Новичок
Регистрация
10.09.2015
Сообщения
4
Реакции
0
Баллы
1
Hi

Is there a way of checking whether a text file contains any characters a-z then doing an IF on that result.

I was orginally use count lines but I was finding that even if the lines was blank it still counted.

Thanks
 
Figure it out:
Read file to variable- regex: [A-Za-z0-9] -> if 'Variable'==0
 
Just a friendly note. That regex will give you a match for each letter or number. The match is also not limited to integer values and should therefor use quotes when using IF.
PHP:
Развернуть Свернуть Копировать
"{-Variable.Name-}" == "" // Variable is empty
"{-Variable.Name-}" != "" // Variable is not empty
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)