Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8105 > unrolled thread
| Started by | bill <william@TechServSys.com> |
|---|---|
| First post | 2013-01-20 14:42 -0500 |
| Last post | 2013-01-20 15:01 -0500 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.php
Passing complex data back when using cURL bill <william@TechServSys.com> - 2013-01-20 14:42 -0500
Re: Passing complex data back when using cURL Jerry Stuckle <jstucklex@attglobal.net> - 2013-01-20 14:56 -0500
Re: Passing complex data back when using cURL bill <william@TechServSys.com> - 2013-01-20 15:01 -0500
| From | bill <william@TechServSys.com> |
|---|---|
| Date | 2013-01-20 14:42 -0500 |
| Subject | Passing complex data back when using cURL |
| Message-ID | <kdhhap$l9f$1@speranza.aioe.org> |
I need to take an array that contains arrays and pass it back to the script that asked for it using cURL. I have set CURLOPT_RETURNTRANSFER to 1 so the data comes back to a variable in the calling program. The data is alphaneumeric and contains "@" as part of email addresses. I want to have the data back in an array or arrays in the calling script. I looked at serialize, but fear that the null bytes would not transfer properly. I looked at json_encode/decode but wonder about the options. What would be the best way to move the data from the server back to the cURL client ? -bill
[toc] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-01-20 14:56 -0500 |
| Message-ID | <kdhi5u$gd5$1@dont-email.me> |
| In reply to | #8105 |
On 1/20/2013 2:42 PM, bill wrote: > I need to take an array that contains arrays and pass it back to the > script that asked for it using cURL. I have set CURLOPT_RETURNTRANSFER > to 1 so the data comes back to a variable in the calling program. > > The data is alphaneumeric and contains "@" as part of email addresses. > > I want to have the data back in an array or arrays in the calling script. > > I looked at serialize, but fear that the null bytes would not transfer > properly. > > I looked at json_encode/decode but wonder about the options. > > What would be the best way to move the data from the server back to the > cURL client ? > > -bill Generally the best way would be to use json. You could also do something like serialize the data and then base64 encode the data. Other ways are possible also, but more complicated. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | bill <william@TechServSys.com> |
|---|---|
| Date | 2013-01-20 15:01 -0500 |
| Message-ID | <kdhifb$o8b$1@speranza.aioe.org> |
| In reply to | #8106 |
On 1/20/2013 2:56 PM, Jerry Stuckle wrote: > On 1/20/2013 2:42 PM, bill wrote: >> I need to take an array that contains arrays and pass it back >> to the >> script that asked for it using cURL. I have set >> CURLOPT_RETURNTRANSFER >> to 1 so the data comes back to a variable in the calling program. >> >> The data is alphaneumeric and contains "@" as part of email >> addresses. >> >> I want to have the data back in an array or arrays in the >> calling script. >> >> I looked at serialize, but fear that the null bytes would not >> transfer >> properly. >> >> I looked at json_encode/decode but wonder about the options. >> >> What would be the best way to move the data from the server >> back to the >> cURL client ? >> >> -bill > > Generally the best way would be to use json. You could also do > something like serialize the data and then base64 encode the data. > > Other ways are possible also, but more complicated. > Thanks Jerry, simple is good. bill
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web