I have a PHP script that submits a curl request to market.android.com/mylibrary and retrieves the page, then parses it using regex. In the first link below you can see that when run it will output "Something went wrongSomething went wrong" corresponding to each of the regex tests at the bottom. Now if you comment line 74 and uncomment 75 it will work. If you would like to see what the curl is returning just add echo($result);
at the bottom.
Be sure to fill in your Google creds at the top and enable curl in your webserver --> Example file 1
Now in this second example I have taken only the relevant portions from the curl results and manually escaped all the apostrophes. I put the same regex strings at the bottom and it works exactly as expected.
Is anyone able to see what is causing the problem? I have tried using preg_last_error() but it simply returns 0
. Thanks!