0

我需要获取“fsdfsdf”的字符长度。谁能帮我?:)

$array = array(
    'Firstname' => $wpdb->escape($_REQUEST['Firstname']),
    'Lastname' => $wpdb->escape($_REQUEST['Lastname']),
    'Phone' => $wpdb->escape($_REQUEST['Phone']),
    'Email' => $wpdb->escape($_REQUEST['Email'])
);

打印_r($数组):

Array
(
    [Firstname] => fsdfsdf
    [Lastname] => 
    [Phone] => 
    [Email] =>
)
4

3 回答 3

3
$char_length = strlen($array['Firstname']);
于 2013-11-03T09:40:30.970 回答
1

试试这个,

$length =   strlen($array[Firstname]);
echo $length;
于 2013-11-03T09:41:43.007 回答
1

希望对你有帮助

 echo strlen(trim($array['Firstname']));
于 2013-11-03T09:42:27.213 回答