Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
450 views
in Technique[技术] by (71.8m points)

laravel 5 - php strlen returning incorrect values

I'm using laravel 5.7, and i decided to play with some strings, here comes my problem, basically, my code in my controller goes like this.

$from = strlen($request->from);

$to  = strlen($request->to);
  
return array('from_len' => $from, 'to_len'=>$to);

what I'm sending in postman is like this

"direction" : true,
"to" : "",
"from" : "?"

and what return is this

{
 "from_len": 3,
 "to_len": 0
}

So yeah i don't understand what is happening.

Thanks in advance for your attention people.

question from:https://stackoverflow.com/questions/65938432/php-strlen-returning-incorrect-values

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...