I have a raw form-data that looks like this:
- - -------- V2ymHFg03ehbqgZCaKO6jy Content-presentation: Form-data; Name = "intro" o ------------ V2ymHFg03ehbqgZCaKO6jy Content-Vision: form-data; Name = "title" T ------------ V2ymHFg03ehbqgZCaKO6jy content- Disposition: form-data; Name = "apiKey" 98d32fdsa ------------ V2ymHFg03ehbqgZCaKO6jy Content-Vision: form-data; Name = "method" / media / add ------------ V2ymHFg03ehbqgZCaKO6jy content- Disposition: form-data; Name = "upload_field"; Filename = "original_filename.png" content-type: image / png ------------ V2ymHFg03ehbqgZCaKO6jy-- (upload file instead of the second line of this file (Here invisible). So my question is:
How to parsize data to create a table:
$ result ['intro'] and so on inside the data?
$ border = "------------ V2ymHFg03ehbqgZCaKO6jy"; // it's content-type $ raw field = explosion ($ range, $ data); array_pop ($ raw field); // previous Drop - ($ $, $ $ Content) = Explosion ("\ r \ n \ r \ n", $ block, 2); // I think this is & lt; CR & gt; & lt; lf & gt; ; By checking the standards, maybe! If (preg_match ('/ name =' ([^ "] *)" / i ', $ mime, $ match {$ result [$ match [1]] = $ Content; // todo: make things look like with other fields} and {$ result [] = $ content; // just in case ...}}
cleanup
< P> Edit: You should also trim the new line from each content block, but rtrim break more than one Newline Will, so a little more creative.
Comments
Post a Comment