amardilo Posted May 5, 2010 Share Posted May 5, 2010 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 More sharing options...
jamesxg1 Posted May 5, 2010 Share Posted May 5, 2010 This is a custom function, it seems it might be doing the same thing as this. http_build_query($data, '', '&'); James. Link to comment https://forums.phpfreaks.com/topic/200787-whats-aspoststring/#findComment-1053564 Share on other sites More sharing options...
Mchl Posted May 5, 2010 Share Posted May 5, 2010 See definition of the class you're using (as it doesn't seem to be any class that's shipped with PHP). Link to comment https://forums.phpfreaks.com/topic/200787-whats-aspoststring/#findComment-1053565 Share on other sites More sharing options...
amardilo Posted May 5, 2010 Author Share Posted May 5, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.