0

I learned how to use the string-length function

<?php

$text = "this way";
if (strlen($text) > 5) { //characters
    echo "something";
}

and I want to use something like it that applies to number variables.

$text = 7;

What function would that be?

Darragh Enright
  • 13,676
  • 7
  • 41
  • 48

1 Answers1

0

Are you trying to find out how many digits are in a number? strlen() will still work there.

Are you trying to record how many letters are in the string? $text_len = strlen($text); will do that for you.

QHeagy
  • 38
  • 6