Home > Backend Development > PHP Tutorial > php写pkcs5报错

php写pkcs5报错

WBOY
Release: 2016-06-23 14:20:56
Original
927 people have browsed it

这是代码:

function pkcs5_pad ($text, $blocksize)	{				$pad = $blocksize ? (strlen($text) % $blocksize);		return $text . str_repeat(chr($pad), $pad);	}
Copy after login


报错:Parse error: syntax error, unexpected T_STRING

报错的句子是:$pad = $blocksize ? (strlen($text) % $blocksize);

什么原因啊?


回复讨论(解决方案)

有非法字符

function pkcs5_pad($text, $blocksize){  $pad = $blocksize - (strlen($text) % $blocksize);  return $text . str_repeat(chr($pad), $pad);}
Copy after login

老xu威武!!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template