开发者

jquery array to php JSON

I have various textnodes (p) and headers that I extract using jquery and store into an array :

var textnode = $(source).children("p:not(:has(img))").map(function () {
    return $(this).outerHTML();
}).get();
var headerone = $(开发者_C百科source).children('h1').map(function () {
    return $(this).outerHTML();
}).get();

I need to take the textnode array and headerone array and pass it via ajax to a php script (which will consequently store it in mysql). Does serializeArray work in this case or could I use .stringify. Would I need to .decode this in php (version 5.3.4)?


If you send it via jQuery Ajax, it will be automatically serialized and will be available to your PHP as a $_REQUEST array variable.

http://api.jquery.com/jQuery.ajax/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜