PHPで直列化しようとすると、この文字列はfalseと表示されます。直列化された文字列のオフセットエラーが意味を持たない
私は2つのオンラインシリアライズウェブサイトを使用しています。
最初のテストは正常に戻ります。このサイト:http://blog.tanist.co.uk/files/unserialize/
他のウェブサイトは本当の問題を示しています。それとも?よくわかりません。これは、このサイトです:https://www.functions-online.com/unserialize.html
私が得る最初のエラーがある「1095 7441バイトのオフセット」(スニペットにライン12上にある)s:6:"filter";
で「トン」
Iで正確である 何らかの理由で文字カウントを4として読み込んでいるとしますか? 引用符を含めてすべての文字を置き換えようとしましたが、複数のバイトを表す文字の奇妙なバージョンではないことを確認しました。それはうまくいかなかった。しかし、私が "フィルタ"を "filt"に変更した場合、それは機能しました。それは次のオフセット誤差に移動した。
私はオンラインで見つけた解決策、シリアル化する前に文字列に多くの変換を試みました。
utf8_encode
base64_decode
どれも役に立たなかった。
ここに文字列があります。
a:13:{i:3;a:4:{s:5:"title";s:16:"Regional Offices";s:4:"text";s:1025:"<p>
<a href="/who-we-are/structure/conferences/alaska/">Alaska Conference of the Evangelical Covenant Church</a><br />
<a href="/who-we-are/structure/conferences/canada/">Evangelical Covenant Church of Canada</a><br />
<a href="/who-we-are/structure/conferences/central/">Central Conference</a><br />
<a href="/who-we-are/structure/conferences/east-coast/">East Coast Conference</a><br />
<a href="/who-we-are/structure/conferences/great-lakes/">Great Lakes Conference</a><br />
<a href="/who-we-are/structure/conferences/midsouth/">Midsouth Conference</a><br />
<a href="/who-we-are/structure/conferences/midwest/">Midwest Conference</a><br />
<a href="/who-we-are/structure/conferences/northwest/">Northwest Conference</a><br />
<a href="/who-we-are/structure/conferences/north-pacific/">Pacific Northwest Conference</a><br />
<a href="/who-we-are/structure/conferences/pacific-southwest/">Pacific Southwest Conference</a><br />
<a href="/who-we-are/structure/conferences/southeast/">Southeast Conference</a></p>";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:4;a:4:{s:5:"title";s:9:"Translate";s:4:"text";s:614:"<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
gaTrack: true,
gaId: 'UA-2683611-22',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<p><span style="font-size:10px; line-height:11px"><br /><strong>Disclaimer</strong>: This translation may not be completely accurate as it is generated by a computer.</span><br /> </p>";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:5;a:4:{s:5:"title";s:10:"Contact Us";s:4:"text";s:920:"<p>The Evangelical Covenant Church<br />
8303 West Higgins Road<br />
Chicago, Illinois 60631<br />
<a href="http://www.covchurch.org/who-we-are/help/contact-us/">Contact us</a></p>
<h3>Stay Connected</h3>
<p><a href="http://www.facebook.com/covchurch" target="_blank"><img src="/wp-content/uploads/2013/07/ecc-facebook.png" width="35" /></a> <a href="http://www.twitter.com/cov_church" target="_blank"><img src="/wp-content/uploads/2013/07/ecc-twitter.png" width="35" /></a> <a href="http://www.instagram.com/cov_church" target="_blank"><img src="/wp-content/uploads/2013/07/ecc-instagram.png" width="35" /></a> <a href="http://www.covchurch.tv" target="_blank"><img src="/wp-content/uploads/2013/07/ecc-dottv.png" width="35" /></a> <a href="http://www.covchurch.org/subscribe" target="_blank"><img src="/wp-content/uploads/2013/07/ecc-rss.png" width="35" /></a></p>";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:6;a:4:{s:5:"title";s:21:"Affiliated Ministries";s:4:"text";s:1093:"<p><a href="/affiliated/camps-retreat-center/">Camps and Retreat Centers</a><br />
<a href="http://www.chet.org/" target="_blank" title="CHET">CHET: Hispanic Theological Studies</a><br />
<a href="http://covcare.org/" target="_blank" title="CIC">Covenant Initiatives for Care</a><br />
<a href="http://www.covenantbenevolence.org/" target="_blank">Covenant Ministries of Benevolence</a><br />
<a href="/benefits/pension/">Covenant Pension Plan</a><br />
<a href="http://www.covenantretirement.org/" target="_blank">Covenant Retirement Communities</a><br />
<a href="http://www.covenanttrust.com/" target="_blank">Covenant Trust Company</a><br />
<a href="/affiliated/health-care-residences/">Health Care and Enabling Residences</a><br />
<a href="/ncp/">National Covenant Properties</a><br />
<a href="http://www.northpark.edu/Seminary.aspx" title="NPTS" target="_blank">North Park Theological Seminary</a><br />
<a href="http://www.northpark.edu" target="_blank" title="NPU">North Park University</a><br />
<a href="http://paulcarlson.org/">Paul Carlson Partnership</a><br />
</p>";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:7;a:3:{s:5:"title";s:0:"";s:4:"text";s:128:"<br /><a href="http://covbooks.com" target="_blank"><img src="/wp-content/uploads/2012/01/covbooks-banner.jpg" border="0" /></a>";s:6:"filter";b:0;}i:8;a:3:{s:5:"title";s:9:"User Poll";s:4:"text";s:244:"<iframe style='width:245px; height:367px; overflow-x:hidden;' frameborder='0' name='proprofs' id='proprofs' src='http://www.proprofs.com/polls/widget/?title=whats-the-length-of-video-that-you-least-likely-to-load&theme=grey&width=237'></iframe>";s:6:"filter";b:0;}i:10;a:4:{s:5:"title";s:20:"Search CovChurch.org";s:4:"text";s:463:"<form action="http://www.covchurch.org/search-covchurch/" id="cse-search-box"><div><input type="hidden" name="cx" value="000453154239674603993:lmfbvipbnwq" /><input type="hidden" name="cof" value="FORID:11" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="24" /><input type="submit" name="sa" value="Search" /></div></form><script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:11;a:4:{s:5:"title";s:20:"Search CovChurch.org";s:4:"text";s:505:"<form action="http://www.covchurch.org/search-covchurch/" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="000453154239674603993:lmfbvipbnwq" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="18" />
<input type="submit" name="sa" value="Search" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:12;a:4:{s:5:"title";s:0:"";s:4:"text";s:128:"<br /><a href="http://covbooks.com" target="_blank"><img src="/wp-content/uploads/2012/01/covbooks-banner.jpg" border="0" /></a>";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:13;a:4:{s:5:"title";s:0:"";s:4:"text";s:128:"<br /><a href="http://covbooks.com" target="_blank"><img src="/wp-content/uploads/2012/01/covbooks-banner.jpg" border="0" /></a>";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:14;a:4:{s:5:"title";s:0:"";s:4:"text";s:424:"<a class="twitter-timeline" href="https://twitter.com/Cov_Church" data-widget-id="347782163544031232">Tweets by @Cov_Church</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
";s:6:"filter";b:0;s:5:"class";s:1:"S";}i:15;a:4:{s:5:"title";s:9:"Translate";s:4:"text";s:678:"<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, multilanguagePage: true, gaTrack: true, gaId: 'UA-2683611-22'}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<div style="margin-top: -15px;"><span style="font-size: 10px; line-height: 11px;">
<strong>Disclaimer</strong>: This translation may not be completely accurate as it is generated by a computer.</span>
</div>";s:6:"filter";b:0;s:5:"class";s:1:"S";}s:12:"_multiwidget";i:1;}
結果をWebフォームに貼り付けると、行末(CR/LFおよびLF)の変更、エンコード(UTF-8 ANSI)の変更などの問題が発生する可能性があります。どのようにシリアル化された文字列を取得しましたか? –
@Igor(前述のように、utf8_general_ciの照合順序でmysqlテーブルから直接コピーされます)。 –