gpt4 book ai didi

php - 无法反序列化字符串

转载 作者:行者123 更新时间:2023-12-04 05:59:26 25 4
gpt4 key购买 nike

有人能告诉我为什么这个字符串不会反序列化吗?我已经尝试了几乎所有的东西(stripslashes、addslashes、trim 等......)

a:10:{s:8:"order_id";s:13:"9006710350464";s:5:"buyer";s:10:"1303912674";s:3:"app";s:15:"223615011031939";s:8:"receiver";s:10:"1303912674";s:6:"amount";s:2:"20";s:11:"time_placed";s:10:"1326235812";s:11:"update_time";s:10:"1326235818";s:4:"data";s:0:"";s:5:"items";a:1:{i:0;a:7:{s:7:"item_id";s:4:"1_48";s:5:"title";s:49:"I\'m Not Jesus Mommy (Full Movie) - 48 Hour Stream";s:11:"description";s:204:"This is a purcahse to watch I\'m Not Jesus Mommy on FilmDemic Movie Streaming for a period of 48 hours. Once you complete the purchase, your account will have access to watch the movie for up to 48 hours.";s:9:"image_url";s:144:"https://filmdemic.com/apps/fb-streaming/wp-main/wp-content/themes/fd-fb-stream-wpf-child/library/images/titles/slidersize/im_not_jesus_mommy.jpg";s:11:"product_url";s:46:"http://filmdemic.com/apps/fb-streaming/film-1";s:5:"price";s:2:"20";s:4:"data";s:37:"film_id=1&wp_user_id=4&view_length=48";}}s:6:"status";s:6:"placed";}

我得到“952 字节偏移 370 处的错误”,但这没有意义,Stream 中的“m”是第 370 个字节。

谢谢!

最佳答案

在位置 324 处有一个不应该出现的斜线。在 PHP 中序列化数据使用字符计数。例如:

s:49:"I\'m Not Jesus Mommy (Full Movie) - 48 Hour Stream"

表示以下引号中将出现 49 个字符的字符串。但是如果计算正确,这个字符串中有一个\使计数为 50 个字符。如果您试图转义它,请取消转义以解决您的问题。

在位置 844(您的 product_url 的末尾)修复此问题后似乎还有另一个错误,它似乎缺少一个字符,可能是 url 中的斜杠,因为 url 是 45 个字符长,但它期待 46 个字符长网址...

所以在更正你的序列化数据后,我得到了这个:

a:10:{s:8:"order_id";s:13:"9006710350464";s:5:"buyer";s:10:"1303912674";s:3:"app";s:15:"223615011031939";s:8:"receiver";s:10:"1303912674";s:6:"amount";s:2:"20";s:11:"time_placed";s:10:"1326235812";s:11:"update_time";s:10:"1326235818";s:4:"data";s:0:"";s:5:"items";a:1:{i:0;a:7:{s:7:"item_id";s:4:"1_48";s:5:"title";s:49:"I'm Not Jesus Mommy (Full Movie) - 48 Hour Stream";s:11:"description";s:204:"This is a purcahse to watch I\'m Not Jesus Mommy on FilmDemic Movie Streaming for a period of 48 hours. Once you complete the purchase, your account will have access to watch the movie for up to 48 hours.";s:9:"image_url";s:144:"https://filmdemic.com/apps/fb-streaming/wp-main/wp-content/themes/fd-fb-stream-wpf-child/library/images/titles/slidersize/im_not_jesus_mommy.jpg";s:11:"product_url";s:46:"http://filmdemic.com/apps/fb-streaming/film-1/";s:5:"price";s:2:"20";s:4:"data";s:37:"film_id=1&wp_user_id=4&view_length=48";}}s:6:"status";s:6:"placed";}



它导致
array (
'order_id' => '9006710350464',
'buyer' => '1303912674',
'app' => '223615011031939',
'receiver' => '1303912674',
'amount' => '20',
'time_placed' => '1326235812',
'update_time' => '1326235818',
'data' => '',
'items' =>
array (
0 =>
array (
'item_id' => '1_48',
'title' => 'I'm Not Jesus Mommy (Full Movie) - 48 Hour Stream',
'description' => 'This is a purcahse to watch I\'m Not Jesus Mommy on FilmDemic Movie Streaming for a period of 48 hours. Once you complete the purchase, your account will have access to watch the movie for up to 48 hours.',
'image_url' => 'https://filmdemic.com/apps/fb-streaming/wp-main/wp-content/themes/fd-fb-stream-wpf-child/library/images/titles/slidersize/im_not_jesus_mommy.jpg',
'product_url' => 'http://filmdemic.com/apps/fb-streaming/film-1/',
'price' => '20',
'data' => 'film_id=1&wp_user_id=4&view_length=48',
),
),
'status' => 'placed',
)

关于php - 无法反序列化字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9101595/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com