0 votes
in SoSci Survey (English) by s006905 (160 points)

I need to check if a string consists only of digits.

But ctype_digit() is not allowed - same with preg_match().

1 Answer

0 votes
by SoSci Survey (304k points)

It depends on what you're planning to do - often it's a good idea to already restrict the input.

But ... preg_match() definitely is allowed on www.soscisurvey.de

preg_match('/^\\d+$/', ...)
by s006905 (160 points)
Yes - preg_match() works and solves the problem. Thanks!

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...