Answers for "php if string length greater than"

PHP
11

how to check php string length

<?php
$name = 'abcdef';
echo strlen($str); // 6

$string = ' ab cd ';
echo strlen($str); // 7
?>
Posted by: Guest on August-24-2020
0

check string length is greater than 0 php

if(strlen(trim($string)) > 0){
   // $string has at least one non-space character
}
Posted by: Guest on July-04-2021

Code answers related to "php if string length greater than"

Browse Popular Code Answers by Language