Jquery AJAX请求数组/对象在发送时切断1000个项目

时间:2012-03-02 15:28:48

标签: jquery ajax object post limit

过去几天这让我发疯了。我编写了一个程序来运行并将结果放入JavaScript对象中。收集结果后,通过ajax请求发送对象以保存在服务器上。每次我发送要保存的结果时,我只会看到结果中保存了1000个项目。

我检查了php.ini文件,它有足够的内存来发送对象(post_max_size和memory_limit都超过8MB)。此外,查看正在发送的标头信息,看起来整个阵列都被发送和接受。

我写了一个显示核心问题的测试程序。这会向test-ajax.php发送一个包含1001个元素的对象。 test-ajax然后将发布的对象放入表格格式并返回表格。当test.php返回表时,它只有1000个元素:

test.php的

<html>
<head>
<script type='text/javascript'   src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<script type='text/javascript'>

$(document).ready(function(){

    var testObj = {"0":{"0":"value0"},"1":{"0":"value1"},"2":{"0":"value2"},"3":{"0":"value3"},"4":{"0":"value4"},"5":{"0":"value5"},"6":{"0":"value6"},"7":{"0":"value7"},"8":{"0":"value8"},"9":{"0":"value9"},"10":{"0":"value10"},"11":{"0":"value11"},"12":{"0":"value12"},"13":{"0":"value13"},"14":{"0":"value14"},"15":{"0":"value15"},"16":{"0":"value16"},"17":{"0":"value17"},"18":{"0":"value18"},"19":{"0":"value19"},"20":{"0":"value20"},"21":{"0":"value21"},"22":{"0":"value22"},"23":{"0":"value23"},"24":{"0":"value24"},"25":{"0":"value25"},"26":{"0":"value26"},"27":{"0":"value27"},"28":{"0":"value28"},"29":{"0":"value29"},"30":{"0":"value30"},"31":{"0":"value31"},"32":{"0":"value32"},"33":{"0":"value33"},"34":{"0":"value34"},"35":{"0":"value35"},"36":{"0":"value36"},"37":{"0":"value37"},"38":{"0":"value38"},"39":{"0":"value39"},"40":{"0":"value40"},"41":{"0":"value41"},"42":{"0":"value42"},"43":{"0":"value43"},"44":{"0":"value44"},"45":{"0":"value45"},"46":{"0":"value46"},"47":{"0":"value47"},"48":{"0":"value48"},"49":{"0":"value49"},"50":{"0":"value50"},"51":{"0":"value51"},"52":{"0":"value52"},"53":{"0":"value53"},"54":{"0":"value54"},"55":{"0":"value55"},"56":{"0":"value56"},"57":{"0":"value57"},"58":{"0":"value58"},"59":{"0":"value59"},"60":{"0":"value60"},"61":{"0":"value61"},"62":{"0":"value62"},"63":{"0":"value63"},"64":{"0":"value64"},"65":{"0":"value65"},"66":{"0":"value66"},"67":{"0":"value67"},"68":{"0":"value68"},"69":{"0":"value69"},"70":{"0":"value70"},"71":{"0":"value71"},"72":{"0":"value72"},"73":{"0":"value73"},"74":{"0":"value74"},"75":{"0":"value75"},"76":{"0":"value76"},"77":{"0":"value77"},"78":{"0":"value78"},"79":{"0":"value79"},"80":{"0":"value80"},"81":{"0":"value81"},"82":{"0":"value82"},"83":{"0":"value83"},"84":{"0":"value84"},"85":{"0":"value85"},"86":{"0":"value86"},"87":{"0":"value87"},"88":{"0":"value88"},"89":{"0":"value89"},"90":{"0":"value90"},"91":{"0":"value91"},"92":{"0":"value92"},"93":{"0":"value93"},"94":{"0":"value94"},"95":{"0":"value95"},"96":{"0":"value96"},"97":{"0":"value97"},"98":{"0":"value98"},"99":{"0":"value99"},"100":{"0":"value100"},"101":{"0":"value101"},"102":{"0":"value102"},"103":{"0":"value103"},"104":{"0":"value104"},"105":{"0":"value105"},"106":{"0":"value106"},"107":{"0":"value107"},"108":{"0":"value108"},"109":{"0":"value109"},"110":{"0":"value110"},"111":{"0":"value111"},"112":{"0":"value112"},"113":{"0":"value113"},"114":{"0":"value114"},"115":{"0":"value115"},"116":{"0":"value116"},"117":{"0":"value117"},"118":{"0":"value118"},"119":{"0":"value119"},"120":{"0":"value120"},"121":{"0":"value121"},"122":{"0":"value122"},"123":{"0":"value123"},"124":{"0":"value124"},"125":{"0":"value125"},"126":{"0":"value126"},"127":{"0":"value127"},"128":{"0":"value128"},"129":{"0":"value129"},"130":{"0":"value130"},"131":{"0":"value131"},"132":{"0":"value132"},"133":{"0":"value133"},"134":{"0":"value134"},"135":{"0":"value135"},"136":{"0":"value136"},"137":{"0":"value137"},"138":{"0":"value138"},"139":{"0":"value139"},"140":{"0":"value140"},"141":{"0":"value141"},"142":{"0":"value142"},"143":{"0":"value143"},"144":{"0":"value144"},"145":{"0":"value145"},"146":{"0":"value146"},"147":{"0":"value147"},"148":{"0":"value148"},"149":{"0":"value149"},"150":{"0":"value150"},"151":{"0":"value151"},"152":{"0":"value152"},"153":{"0":"value153"},"154":{"0":"value154"},"155":{"0":"value155"},"156":{"0":"value156"},"157":{"0":"value157"},"158":{"0":"value158"},"159":{"0":"value159"},"160":{"0":"value160"},"161":{"0":"value161"},"162":{"0":"value162"},"163":{"0":"value163"},"164":{"0":"value164"},"165":{"0":"value165"},"166":{"0":"value166"},"167":{"0":"value167"},"168":{"0":"value168"},"169":{"0":"value169"},"170":{"0":"value170"},"171":{"0":"value171"},"172":{"0":"value172"},"173":{"0":"value173"},"174":{"0":"value174"},"175":{"0":"value175"},"176":{"0":"value176"},"177":{"0":"value177"},"178":{"0":"value178"},"179":{"0":"value179"},"180":{"0":"value180"},"181":{"0":"value181"},"182":{"0":"value182"},"183":{"0":"value183"},"184":{"0":"value184"},"185":{"0":"value185"},"186":{"0":"value186"},"187":{"0":"value187"},"188":{"0":"value188"},"189":{"0":"value189"},"190":{"0":"value190"},"191":{"0":"value191"},"192":{"0":"value192"},"193":{"0":"value193"},"194":{"0":"value194"},"195":{"0":"value195"},"196":{"0":"value196"},"197":{"0":"value197"},"198":{"0":"value198"},"199":{"0":"value199"},"200":{"0":"value200"},"201":{"0":"value201"},"202":{"0":"value202"},"203":{"0":"value203"},"204":{"0":"value204"},"205":{"0":"value205"},"206":{"0":"value206"},"207":{"0":"value207"},"208":{"0":"value208"},"209":{"0":"value209"},"210":{"0":"value210"},"211":{"0":"value211"},"212":{"0":"value212"},"213":{"0":"value213"},"214":{"0":"value214"},"215":{"0":"value215"},"216":{"0":"value216"},"217":{"0":"value217"},"218":{"0":"value218"},"219":{"0":"value219"},"220":{"0":"value220"},"221":{"0":"value221"},"222":{"0":"value222"},"223":{"0":"value223"},"224":{"0":"value224"},"225":{"0":"value225"},"226":{"0":"value226"},"227":{"0":"value227"},"228":{"0":"value228"},"229":{"0":"value229"},"230":{"0":"value230"},"231":{"0":"value231"},"232":{"0":"value232"},"233":{"0":"value233"},"234":{"0":"value234"},"235":{"0":"value235"},"236":{"0":"value236"},"237":{"0":"value237"},"238":{"0":"value238"},"239":{"0":"value239"},"240":{"0":"value240"},"241":{"0":"value241"},"242":{"0":"value242"},"243":{"0":"value243"},"244":{"0":"value244"},"245":{"0":"value245"},"246":{"0":"value246"},"247":{"0":"value247"},"248":{"0":"value248"},"249":{"0":"value249"},"250":{"0":"value250"},"251":{"0":"value251"},"252":{"0":"value252"},"253":{"0":"value253"},"254":{"0":"value254"},"255":{"0":"value255"},"256":{"0":"value256"},"257":{"0":"value257"},"258":{"0":"value258"},"259":{"0":"value259"},"260":{"0":"value260"},"261":{"0":"value261"},"262":{"0":"value262"},"263":{"0":"value263"},"264":{"0":"value264"},"265":{"0":"value265"},"266":{"0":"value266"},"267":{"0":"value267"},"268":{"0":"value268"},"269":{"0":"value269"},"270":{"0":"value270"},"271":{"0":"value271"},"272":{"0":"value272"},"273":{"0":"value273"},"274":{"0":"value274"},"275":{"0":"value275"},"276":{"0":"value276"},"277":{"0":"value277"},"278":{"0":"value278"},"279":{"0":"value279"},"280":{"0":"value280"},"281":{"0":"value281"},"282":{"0":"value282"},"283":{"0":"value283"},"284":{"0":"value284"},"285":{"0":"value285"},"286":{"0":"value286"},"287":{"0":"value287"},"288":{"0":"value288"},"289":{"0":"value289"},"290":{"0":"value290"},"291":{"0":"value291"},"292":{"0":"value292"},"293":{"0":"value293"},"294":{"0":"value294"},"295":{"0":"value295"},"296":{"0":"value296"},"297":{"0":"value297"},"298":{"0":"value298"},"299":{"0":"value299"},"300":{"0":"value300"},"301":{"0":"value301"},"302":{"0":"value302"},"303":{"0":"value303"},"304":{"0":"value304"},"305":{"0":"value305"},"306":{"0":"value306"},"307":{"0":"value307"},"308":{"0":"value308"},"309":{"0":"value309"},"310":{"0":"value310"},"311":{"0":"value311"},"312":{"0":"value312"},"313":{"0":"value313"},"314":{"0":"value314"},"315":{"0":"value315"},"316":{"0":"value316"},"317":{"0":"value317"},"318":{"0":"value318"},"319":{"0":"value319"},"320":{"0":"value320"},"321":{"0":"value321"},"322":{"0":"value322"},"323":{"0":"value323"},"324":{"0":"value324"},"325":{"0":"value325"},"326":{"0":"value326"},"327":{"0":"value327"},"328":{"0":"value328"},"329":{"0":"value329"},"330":{"0":"value330"},"331":{"0":"value331"},"332":{"0":"value332"},"333":{"0":"value333"},"334":{"0":"value334"},"335":{"0":"value335"},"336":{"0":"value336"},"337":{"0":"value337"},"338":{"0":"value338"},"339":{"0":"value339"},"340":{"0":"value340"},"341":{"0":"value341"},"342":{"0":"value342"},"343":{"0":"value343"},"344":{"0":"value344"},"345":{"0":"value345"},"346":{"0":"value346"},"347":{"0":"value347"},"348":{"0":"value348"},"349":{"0":"value349"},"350":{"0":"value350"},"351":{"0":"value351"},"352":{"0":"value352"},"353":{"0":"value353"},"354":{"0":"value354"},"355":{"0":"value355"},"356":{"0":"value356"},"357":{"0":"value357"},"358":{"0":"value358"},"359":{"0":"value359"},"360":{"0":"value360"},"361":{"0":"value361"},"362":{"0":"value362"},"363":{"0":"value363"},"364":{"0":"value364"},"365":{"0":"value365"},"366":{"0":"value366"},"367":{"0":"value367"},"368":{"0":"value368"},"369":{"0":"value369"},"370":{"0":"value370"},"371":{"0":"value371"},"372":{"0":"value372"},"373":{"0":"value373"},"374":{"0":"value374"},"375":{"0":"value375"},"376":{"0":"value376"},"377":{"0":"value377"},"378":{"0":"value378"},"379":{"0":"value379"},"380":{"0":"value380"},"381":{"0":"value381"},"382":{"0":"value382"},"383":{"0":"value383"},"384":{"0":"value384"},"385":{"0":"value385"},"386":{"0":"value386"},"387":{"0":"value387"},"388":{"0":"value388"},"389":{"0":"value389"},"390":{"0":"value390"},"391":{"0":"value391"},"392":{"0":"value392"},"393":{"0":"value393"},"394":{"0":"value394"},"395":{"0":"value395"},"396":{"0":"value396"},"397":{"0":"value397"},"398":{"0":"value398"},"399":{"0":"value399"},"400":{"0":"value400"},"401":{"0":"value401"},"402":{"0":"value402"},"403":{"0":"value403"},"404":{"0":"value404"},"405":{"0":"value405"},"406":{"0":"value406"},"407":{"0":"value407"},"408":{"0":"value408"},"409":{"0":"value409"},"410":{"0":"value410"},"411":{"0":"value411"},"412":{"0":"value412"},"413":{"0":"value413"},"414":{"0":"value414"},"415":{"0":"value415"},"416":{"0":"value416"},"417":{"0":"value417"},"418":{"0":"value418"},"419":{"0":"value419"},"420":{"0":"value420"},"421":{"0":"value421"},"422":{"0":"value422"},"423":{"0":"value423"},"424":{"0":"value424"},"425":{"0":"value425"},"426":{"0":"value426"},"427":{"0":"value427"},"428":{"0":"value428"},"429":{"0":"value429"},"430":{"0":"value430"},"431":{"0":"value431"},"432":{"0":"value432"},"433":{"0":"value433"},"434":{"0":"value434"},"435":{"0":"value435"},"436":{"0":"value436"},"437":{"0":"value437"},"438":{"0":"value438"},"439":{"0":"value439"},"440":{"0":"value440"},"441":{"0":"value441"},"442":{"0":"value442"},"443":{"0":"value443"},"444":{"0":"value444"},"445":{"0":"value445"},"446":{"0":"value446"},"447":{"0":"value447"},"448":{"0":"value448"},"449":{"0":"value449"},"450":{"0":"value450"},"451":{"0":"value451"},"452":{"0":"value452"},"453":{"0":"value453"},"454":{"0":"value454"},"455":{"0":"value455"},"456":{"0":"value456"},"457":{"0":"value457"},"458":{"0":"value458"},"459":{"0":"value459"},"460":{"0":"value460"},"461":{"0":"value461"},"462":{"0":"value462"},"463":{"0":"value463"},"464":{"0":"value464"},"465":{"0":"value465"},"466":{"0":"value466"},"467":{"0":"value467"},"468":{"0":"value468"},"469":{"0":"value469"},"470":{"0":"value470"},"471":{"0":"value471"},"472":{"0":"value472"},"473":{"0":"value473"},"474":{"0":"value474"},"475":{"0":"value475"},"476":{"0":"value476"},"477":{"0":"value477"},"478":{"0":"value478"},"479":{"0":"value479"},"480":{"0":"value480"},"481":{"0":"value481"},"482":{"0":"value482"},"483":{"0":"value483"},"484":{"0":"value484"},"485":{"0":"value485"},"486":{"0":"value486"},"487":{"0":"value487"},"488":{"0":"value488"},"489":{"0":"value489"},"490":{"0":"value490"},"491":{"0":"value491"},"492":{"0":"value492"},"493":{"0":"value493"},"494":{"0":"value494"},"495":{"0":"value495"},"496":{"0":"value496"},"497":{"0":"value497"},"498":{"0":"value498"},"499":{"0":"value499"},"500":{"0":"value500"},"501":{"0":"value501"},"502":{"0":"value502"},"503":{"0":"value503"},"504":{"0":"value504"},"505":{"0":"value505"},"506":{"0":"value506"},"507":{"0":"value507"},"508":{"0":"value508"},"509":{"0":"value509"},"510":{"0":"value510"},"511":{"0":"value511"},"512":{"0":"value512"},"513":{"0":"value513"},"514":{"0":"value514"},"515":{"0":"value515"},"516":{"0":"value516"},"517":{"0":"value517"},"518":{"0":"value518"},"519":{"0":"value519"},"520":{"0":"value520"},"521":{"0":"value521"},"522":{"0":"value522"},"523":{"0":"value523"},"524":{"0":"value524"},"525":{"0":"value525"},"526":{"0":"value526"},"527":{"0":"value527"},"528":{"0":"value528"},"529":{"0":"value529"},"530":{"0":"value530"},"531":{"0":"value531"},"532":{"0":"value532"},"533":{"0":"value533"},"534":{"0":"value534"},"535":{"0":"value535"},"536":{"0":"value536"},"537":{"0":"value537"},"538":{"0":"value538"},"539":{"0":"value539"},"540":{"0":"value540"},"541":{"0":"value541"},"542":{"0":"value542"},"543":{"0":"value543"},"544":{"0":"value544"},"545":{"0":"value545"},"546":{"0":"value546"},"547":{"0":"value547"},"548":{"0":"value548"},"549":{"0":"value549"},"550":{"0":"value550"},"551":{"0":"value551"},"552":{"0":"value552"},"553":{"0":"value553"},"554":{"0":"value554"},"555":{"0":"value555"},"556":{"0":"value556"},"557":{"0":"value557"},"558":{"0":"value558"},"559":{"0":"value559"},"560":{"0":"value560"},"561":{"0":"value561"},"562":{"0":"value562"},"563":{"0":"value563"},"564":{"0":"value564"},"565":{"0":"value565"},"566":{"0":"value566"},"567":{"0":"value567"},"568":{"0":"value568"},"569":{"0":"value569"},"570":{"0":"value570"},"571":{"0":"value571"},"572":{"0":"value572"},"573":{"0":"value573"},"574":{"0":"value574"},"575":{"0":"value575"},"576":{"0":"value576"},"577":{"0":"value577"},"578":{"0":"value578"},"579":{"0":"value579"},"580":{"0":"value580"},"581":{"0":"value581"},"582":{"0":"value582"},"583":{"0":"value583"},"584":{"0":"value584"},"585":{"0":"value585"},"586":{"0":"value586"},"587":{"0":"value587"},"588":{"0":"value588"},"589":{"0":"value589"},"590":{"0":"value590"},"591":{"0":"value591"},"592":{"0":"value592"},"593":{"0":"value593"},"594":{"0":"value594"},"595":{"0":"value595"},"596":{"0":"value596"},"597":{"0":"value597"},"598":{"0":"value598"},"599":{"0":"value599"},"600":{"0":"value600"},"601":{"0":"value601"},"602":{"0":"value602"},"603":{"0":"value603"},"604":{"0":"value604"},"605":{"0":"value605"},"606":{"0":"value606"},"607":{"0":"value607"},"608":{"0":"value608"},"609":{"0":"value609"},"610":{"0":"value610"},"611":{"0":"value611"},"612":{"0":"value612"},"613":{"0":"value613"},"614":{"0":"value614"},"615":{"0":"value615"},"616":{"0":"value616"},"617":{"0":"value617"},"618":{"0":"value618"},"619":{"0":"value619"},"620":{"0":"value620"},"621":{"0":"value621"},"622":{"0":"value622"},"623":{"0":"value623"},"624":{"0":"value624"},"625":{"0":"value625"},"626":{"0":"value626"},"627":{"0":"value627"},"628":{"0":"value628"},"629":{"0":"value629"},"630":{"0":"value630"},"631":{"0":"value631"},"632":{"0":"value632"},"633":{"0":"value633"},"634":{"0":"value634"},"635":{"0":"value635"},"636":{"0":"value636"},"637":{"0":"value637"},"638":{"0":"value638"},"639":{"0":"value639"},"640":{"0":"value640"},"641":{"0":"value641"},"642":{"0":"value642"},"643":{"0":"value643"},"644":{"0":"value644"},"645":{"0":"value645"},"646":{"0":"value646"},"647":{"0":"value647"},"648":{"0":"value648"},"649":{"0":"value649"},"650":{"0":"value650"},"651":{"0":"value651"},"652":{"0":"value652"},"653":{"0":"value653"},"654":{"0":"value654"},"655":{"0":"value655"},"656":{"0":"value656"},"657":{"0":"value657"},"658":{"0":"value658"},"659":{"0":"value659"},"660":{"0":"value660"},"661":{"0":"value661"},"662":{"0":"value662"},"663":{"0":"value663"},"664":{"0":"value664"},"665":{"0":"value665"},"666":{"0":"value666"},"667":{"0":"value667"},"668":{"0":"value668"},"669":{"0":"value669"},"670":{"0":"value670"},"671":{"0":"value671"},"672":{"0":"value672"},"673":{"0":"value673"},"674":{"0":"value674"},"675":{"0":"value675"},"676":{"0":"value676"},"677":{"0":"value677"},"678":{"0":"value678"},"679":{"0":"value679"},"680":{"0":"value680"},"681":{"0":"value681"},"682":{"0":"value682"},"683":{"0":"value683"},"684":{"0":"value684"},"685":{"0":"value685"},"686":{"0":"value686"},"687":{"0":"value687"},"688":{"0":"value688"},"689":{"0":"value689"},"690":{"0":"value690"},"691":{"0":"value691"},"692":{"0":"value692"},"693":{"0":"value693"},"694":{"0":"value694"},"695":{"0":"value695"},"696":{"0":"value696"},"697":{"0":"value697"},"698":{"0":"value698"},"699":{"0":"value699"},"700":{"0":"value700"},"701":{"0":"value701"},"702":{"0":"value702"},"703":{"0":"value703"},"704":{"0":"value704"},"705":{"0":"value705"},"706":{"0":"value706"},"707":{"0":"value707"},"708":{"0":"value708"},"709":{"0":"value709"},"710":{"0":"value710"},"711":{"0":"value711"},"712":{"0":"value712"},"713":{"0":"value713"},"714":{"0":"value714"},"715":{"0":"value715"},"716":{"0":"value716"},"717":{"0":"value717"},"718":{"0":"value718"},"719":{"0":"value719"},"720":{"0":"value720"},"721":{"0":"value721"},"722":{"0":"value722"},"723":{"0":"value723"},"724":{"0":"value724"},"725":{"0":"value725"},"726":{"0":"value726"},"727":{"0":"value727"},"728":{"0":"value728"},"729":{"0":"value729"},"730":{"0":"value730"},"731":{"0":"value731"},"732":{"0":"value732"},"733":{"0":"value733"},"734":{"0":"value734"},"735":{"0":"value735"},"736":{"0":"value736"},"737":{"0":"value737"},"738":{"0":"value738"},"739":{"0":"value739"},"740":{"0":"value740"},"741":{"0":"value741"},"742":{"0":"value742"},"743":{"0":"value743"},"744":{"0":"value744"},"745":{"0":"value745"},"746":{"0":"value746"},"747":{"0":"value747"},"748":{"0":"value748"},"749":{"0":"value749"},"750":{"0":"value750"},"751":{"0":"value751"},"752":{"0":"value752"},"753":{"0":"value753"},"754":{"0":"value754"},"755":{"0":"value755"},"756":{"0":"value756"},"757":{"0":"value757"},"758":{"0":"value758"},"759":{"0":"value759"},"760":{"0":"value760"},"761":{"0":"value761"},"762":{"0":"value762"},"763":{"0":"value763"},"764":{"0":"value764"},"765":{"0":"value765"},"766":{"0":"value766"},"767":{"0":"value767"},"768":{"0":"value768"},"769":{"0":"value769"},"770":{"0":"value770"},"771":{"0":"value771"},"772":{"0":"value772"},"773":{"0":"value773"},"774":{"0":"value774"},"775":{"0":"value775"},"776":{"0":"value776"},"777":{"0":"value777"},"778":{"0":"value778"},"779":{"0":"value779"},"780":{"0":"value780"},"781":{"0":"value781"},"782":{"0":"value782"},"783":{"0":"value783"},"784":{"0":"value784"},"785":{"0":"value785"},"786":{"0":"value786"},"787":{"0":"value787"},"788":{"0":"value788"},"789":{"0":"value789"},"790":{"0":"value790"},"791":{"0":"value791"},"792":{"0":"value792"},"793":{"0":"value793"},"794":{"0":"value794"},"795":{"0":"value795"},"796":{"0":"value796"},"797":{"0":"value797"},"798":{"0":"value798"},"799":{"0":"value799"},"800":{"0":"value800"},"801":{"0":"value801"},"802":{"0":"value802"},"803":{"0":"value803"},"804":{"0":"value804"},"805":{"0":"value805"},"806":{"0":"value806"},"807":{"0":"value807"},"808":{"0":"value808"},"809":{"0":"value809"},"810":{"0":"value810"},"811":{"0":"value811"},"812":{"0":"value812"},"813":{"0":"value813"},"814":{"0":"value814"},"815":{"0":"value815"},"816":{"0":"value816"},"817":{"0":"value817"},"818":{"0":"value818"},"819":{"0":"value819"},"820":{"0":"value820"},"821":{"0":"value821"},"822":{"0":"value822"},"823":{"0":"value823"},"824":{"0":"value824"},"825":{"0":"value825"},"826":{"0":"value826"},"827":{"0":"value827"},"828":{"0":"value828"},"829":{"0":"value829"},"830":{"0":"value830"},"831":{"0":"value831"},"832":{"0":"value832"},"833":{"0":"value833"},"834":{"0":"value834"},"835":{"0":"value835"},"836":{"0":"value836"},"837":{"0":"value837"},"838":{"0":"value838"},"839":{"0":"value839"},"840":{"0":"value840"},"841":{"0":"value841"},"842":{"0":"value842"},"843":{"0":"value843"},"844":{"0":"value844"},"845":{"0":"value845"},"846":{"0":"value846"},"847":{"0":"value847"},"848":{"0":"value848"},"849":{"0":"value849"},"850":{"0":"value850"},"851":{"0":"value851"},"852":{"0":"value852"},"853":{"0":"value853"},"854":{"0":"value854"},"855":{"0":"value855"},"856":{"0":"value856"},"857":{"0":"value857"},"858":{"0":"value858"},"859":{"0":"value859"},"860":{"0":"value860"},"861":{"0":"value861"},"862":{"0":"value862"},"863":{"0":"value863"},"864":{"0":"value864"},"865":{"0":"value865"},"866":{"0":"value866"},"867":{"0":"value867"},"868":{"0":"value868"},"869":{"0":"value869"},"870":{"0":"value870"},"871":{"0":"value871"},"872":{"0":"value872"},"873":{"0":"value873"},"874":{"0":"value874"},"875":{"0":"value875"},"876":{"0":"value876"},"877":{"0":"value877"},"878":{"0":"value878"},"879":{"0":"value879"},"880":{"0":"value880"},"881":{"0":"value881"},"882":{"0":"value882"},"883":{"0":"value883"},"884":{"0":"value884"},"885":{"0":"value885"},"886":{"0":"value886"},"887":{"0":"value887"},"888":{"0":"value888"},"889":{"0":"value889"},"890":{"0":"value890"},"891":{"0":"value891"},"892":{"0":"value892"},"893":{"0":"value893"},"894":{"0":"value894"},"895":{"0":"value895"},"896":{"0":"value896"},"897":{"0":"value897"},"898":{"0":"value898"},"899":{"0":"value899"},"900":{"0":"value900"},"901":{"0":"value901"},"902":{"0":"value902"},"903":{"0":"value903"},"904":{"0":"value904"},"905":{"0":"value905"},"906":{"0":"value906"},"907":{"0":"value907"},"908":{"0":"value908"},"909":{"0":"value909"},"910":{"0":"value910"},"911":{"0":"value911"},"912":{"0":"value912"},"913":{"0":"value913"},"914":{"0":"value914"},"915":{"0":"value915"},"916":{"0":"value916"},"917":{"0":"value917"},"918":{"0":"value918"},"919":{"0":"value919"},"920":{"0":"value920"},"921":{"0":"value921"},"922":{"0":"value922"},"923":{"0":"value923"},"924":{"0":"value924"},"925":{"0":"value925"},"926":{"0":"value926"},"927":{"0":"value927"},"928":{"0":"value928"},"929":{"0":"value929"},"930":{"0":"value930"},"931":{"0":"value931"},"932":{"0":"value932"},"933":{"0":"value933"},"934":{"0":"value934"},"935":{"0":"value935"},"936":{"0":"value936"},"937":{"0":"value937"},"938":{"0":"value938"},"939":{"0":"value939"},"940":{"0":"value940"},"941":{"0":"value941"},"942":{"0":"value942"},"943":{"0":"value943"},"944":{"0":"value944"},"945":{"0":"value945"},"946":{"0":"value946"},"947":{"0":"value947"},"948":{"0":"value948"},"949":{"0":"value949"},"950":{"0":"value950"},"951":{"0":"value951"},"952":{"0":"value952"},"953":{"0":"value953"},"954":{"0":"value954"},"955":{"0":"value955"},"956":{"0":"value956"},"957":{"0":"value957"},"958":{"0":"value958"},"959":{"0":"value959"},"960":{"0":"value960"},"961":{"0":"value961"},"962":{"0":"value962"},"963":{"0":"value963"},"964":{"0":"value964"},"965":{"0":"value965"},"966":{"0":"value966"},"967":{"0":"value967"},"968":{"0":"value968"},"969":{"0":"value969"},"970":{"0":"value970"},"971":{"0":"value971"},"972":{"0":"value972"},"973":{"0":"value973"},"974":{"0":"value974"},"975":{"0":"value975"},"976":{"0":"value976"},"977":{"0":"value977"},"978":{"0":"value978"},"979":{"0":"value979"},"980":{"0":"value980"},"981":{"0":"value981"},"982":{"0":"value982"},"983":{"0":"value983"},"984":{"0":"value984"},"985":{"0":"value985"},"986":{"0":"value986"},"987":{"0":"value987"},"988":{"0":"value988"},"989":{"0":"value989"},"990":{"0":"value990"},"991":{"0":"value991"},"992":{"0":"value992"},"993":{"0":"value993"},"994":{"0":"value994"},"995":{"0":"value995"},"996":{"0":"value996"},"997":{"0":"value997"},"998":{"0":"value998"},"999":{"0":"value999"},"1000":{"0":"value1000"},"1001":{"0":"value1001"}};

    //send the object
    var url = 'test-ajax.php';

    $.ajax({
        type:'POST',
        data:{obj:testObj},
        url:url,
        success:function(data){

            $('body').html(data);

        }

    });
});
</script>
</head>

<body>

</body>
</html>

测试ajax.php

<table border='1'>
<?php

foreach($_POST['obj'] as $key=>$row){
    echo '<tr>';
    echo '<td>'.$key.'</td>';
    foreach($row as $col)
    {
        echo '<td>'.$col.'</td>';
    }
    echo '</tr>';
};

?>
</table>
你怎么看?谢谢!

1 个答案:

答案 0 :(得分:6)

找到它。在php.ini中有一个名为max_input_vars的设置。默认为1000.将其设置为更高,您将获得对象数组的其余部分。顺便说一句,它也强调了PHP中的一个错误(虽然不是主要的错误)。 1000个元素是0-999,而不是0-1000。 php中的计数器已关闭;)

至少它现在已经解决了。

顺便说一句,我必须重新启动Web服务器(服务)才能使此更改生效。