base64\u解码正在丢失空白

pbwdgjma  于 2021-06-24  发布在  Mysql
关注(0)|答案(1)|浏览(482)

php函数base64正在丢失已解码字符串的空白。
例如:

DQojQ3JlYXRlIHRhYmxlIGFjdGllZg0KDQpDUkVBVEUgVEFCTEUgYGFjdGllZmAgKAogIGBhY3Rp
ZWZfaWRgIGludCgxKSBOT1QgTlVMTCwKICBgYWN0aWVmX29tc2AgdmFyY2hhcigxNSkgTk9UIE5V
TEwKKSBFTkdJTkU9SW5ub0RCIERFRkFVTFQgQ0hBUlNFVD1sYXRpbjE7DQoNCiNEdW1wIGRhdGEN
Cg0KSU5TRVJUIElOVE8gYWN0aWVmIFNFVCBhY3RpZWZfaWQ9JzAnLGFjdGllZl9vbXM9J25pZXQg
YWN0aWVmJzsNCklOU0VSVCBJTlRPIGFjdGllZiBTRVQgYWN0aWVmX2lkPScxJyxhY3RpZWZfb21z
PSdhY3RpZWYnOw0KDQojQ3JlYXRlIHRhYmxlIGJhY2t1cA0KDQpDUkVBVEUgVEFCTEUgYGJhY2t1
cGAgKAogIGBiYWNrdXBfaWRgIGludCgxMSkgTk9UIE5VTEwgQVVUT19JTkNSRU1FTlQsCiAgYGRh
dHVtX2xhc3RfYnVgIGRhdGUgTk9UIE5VTEwsCiAgYGRhdHVtX25leHRfYnVgIGRhdGUgTk9UIE5V

当我使用base64\u decode函数时,它会导致


# Create table actief CREATE TABLE `actief` ( `actief_id` int(1) NOT NULL, `actief_oms` varchar(15) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; #Dump data INSERT INTO actief SET actief_id='0',actief_oms='niet actief'; INSERT INTO actief SET actief_id='1',actief_oms='actief'; #Create table backup CREATE TABLE `backup` ( `backup_id` int(11) NOT NULL AUTO_INCREMENT, `datum_last_bu` date NOT NULL, `datum_next_bu` date NOT NULL, `klant_id` int(11) NOT NULL, `bu_name` varchar(60) NOT NULL, `bu_pad` varchar(60) NOT NULL, `bu_mail_to` varchar(60) NOT NULL, `datum` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`backup_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; #Dump data INSERT INTO backup SET backup_id='1',datum_last_bu='2016-10-01',datum_next_bu='2016-10-04',klant_id='0',bu_name='backup.sql',bu_pad='../backup_my/',bu_mail_to='info@petervankroonenburg.nl',datum='0000-00-00 00:00:00'; #Create table bericht CREATE TABLE `bericht` ( `bericht_id` int(11) NOT NULL AUTO_INCREMENT, `datum_ontv` datetime DEFAULT NULL, `onderwerp` varchar(140) DEFAULT NULL, `bericht` text, `status` int(2) DEFAULT '1', `

但实际上,有一些空格。。。如何解决这个问题?

mdfafbf1

mdfafbf11#

您可以使用html标记pre,如下所示:

<?php
echo "<pre>" . base64_decode($str) . "</pre>";
?>

它会产生带有所需空白的可读信息:)

相关问题