Jump to content

What's asPostString()?


amardilo

Recommended Posts

Hi there,

 

I'm not a PHP developer but have been given some sample code (to help develop an app) written in PHP but there is a line of code in the sample code that I can't find any documentation on:

 

"$curl->setopt(CURLOPT_POSTFIELDS, $curl->asPostString($myData)) ;"

 

It's an app that posts an array ($myData) to a website using cURL, but I can't find out what asPostString() is. The people that sent me the example aren't really answering the question either so I was wondering if someone could tell me if it's a custom class/function that the developers won't send me or is it part of cURL or PHP and if so can someone tell me how I get it working (do I need to include a library)?

Link to comment
https://forums.phpfreaks.com/topic/200787-whats-aspoststring/
Share on other sites

This is a custom function, it seems it might be doing the same thing as this.

http_build_query($data, '', '&');

 

James.

 

Thanks for the help I think that did it.

 

The code they sent me didn't have a function in it called asPostString() so I was getting very confused. The http_build_query string seems to have worked (no idea about the output I get but I am getting something back)!

 

Thanks again jamesxg1 and Mchl

Link to comment
https://forums.phpfreaks.com/topic/200787-whats-aspoststring/#findComment-1053623
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.