0

i need get characters length of "fsdfsdf". Who can help me? :)

$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):

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

3 Answers 3

3
$char_length = strlen($array['Firstname']);
Sign up to request clarification or add additional context in comments.

1 Comment

was very easy, because i was tried get it with $array->Firstname, i dont know why :D
1

Try this,

$length =   strlen($array[Firstname]);
echo $length;

Comments

1

Hope it helps you,

 echo strlen(trim($array['Firstname']));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.