Home > Backend Development > PHP Tutorial > 含有x02x02的字符串 如何还原

含有x02x02的字符串 如何还原

WBOY
Release: 2016-06-20 12:42:57
Original
1527 people have browsed it

加密了一个字符串,在解密输出的数据含有 \x02\x02  例如   test\x02\x02
如何把\x02去掉还原成原本的字符串 test   


回复讨论(解决方案)

去掉了还能解密吗?

去掉了还能解密吗?

 是解密完以后 输出的数据带着\x02

设 $s 为解密后的串,则

$s = rtrim($s, "\x02");
Copy after login
Copy after login

设 $s 为解密后的串,则

$s = rtrim($s, "\x02");
Copy after login
Copy after login

  谢谢版主的热心回答  
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