我需要获取字符长度“sdfsdf”。谁能帮我? :)
$array = array(
'Firstname' => $wpdb->escape($_REQUEST['Firstname']),
'Lastname' => $wpdb->escape($_REQUEST['Lastname']),
'Phone' => $wpdb->escape($_REQUEST['Phone']),
'Email' => $wpdb->escape($_REQUEST['Email'])
);
的print_r($阵列):
Array
(
[Firstname] => fsdfsdf
[Lastname] =>
[Phone] =>
[Email] =>
)
答案 0 :(得分:3)
$char_length = strlen($array['Firstname']);
答案 1 :(得分:1)
试试这个,
$length = strlen($array[Firstname]);
echo $length;
答案 2 :(得分:1)
希望它可以帮到你,
echo strlen(trim($array['Firstname']));