场景看起来像这样
$data=$_REQUEST['data'];
echo $data
the url is www.mysite.com/service.php?data=
and the possible value for the key will be `100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0|100005772653,0|102795882836,0`
Run Code Online (Sandbox Code Playgroud)
我正在编写一个简单的Insert查询.当数据字段的长度超过512个字符时,代码将失败.所以这种情况促使我发布了这样一个极限值的问题.
如果我回显$ data,它只显示一个null(空数据).如果给定的数据少于插入的话.
谁说PHP只能存储512个字符?你做错了什么,你可以存储你想要存储在变量中的任何数量的数据..
正如Alvin Wong分享链接,它说PHP string可以大到2GB
测试用例,尝试运行它
<?php
$string = 'Blah blah';
for($i=1; $i<=10000; $i++) {
$string .= 'Blah blah';
}
echo $string;
?>
Run Code Online (Sandbox Code Playgroud)