Joined October 2012
·
Posted to
Make cURL in PHP less sucky
over 1 year
ago
See also: Buzz Browser
use Buzz\Browser;
$url = "http://www.example.com";
$response = (new Browser())->post(
$url,
array("x-trivial" => "Just as a demo"),
"some body content to be POSTed here"
);
if (!$response->isSuccessful()) {
echo "Error " . $response->getStatusCode() . ": " ;
echo $response->getReasonPhrase();
} else {
echo $response;
}
for a lower level approach to the above.
Posted to
Code For All PHP Developers
over 1 year
ago
foreach ($problems as $problem) {
$this->solve($problem) || $this->execute(self::SHOOT);
}
To make the situation a little more worrying ;)
Posted to
Use the data-force attribute, Luke
over 1 year
ago
Note that $(el).data("key", "value") doesn't add a data-attribute to the HTML, it just modifies an internal jQuery array. If you're planning on modifying things then using the HTML elsewhere, you'll need $(el).attr("data-key", "value").
Achievements
168 Karma
2,319 Total ProTip Views
Altruist
Increase developer well-being by sharing at least 20 open source projects
Epidexipteryx
Have at least one original repo where C++ is the dominant language
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Forked 100
Have a seriously badass project that's been forked at least 100 times
Forked 50
Have a project with a thriving community of users that's been forked at least 50 times
Forked 20
Have an established project that's been forked at least 20 times
Forked
Have a project valued enough to be forked by someone else
Nephila Komaci
Have at least one original repos where PHP is the dominant language
Nephila Komaci 3
Have at least three original repos where PHP is the dominant language
Lemmings 100
Write something great enough to have at least 100 watchers of the project
Charity
Fork and commit to someone's open source project in need
Cub
Have at least one original jQuery or Prototype open source repo
Raven
Have at least one original repo where some form of shell script is the dominant language
Good idea. I'm building new things at the moment, so I wanted other coders to know if they're doing something wrong before it can become a bug later, but if you're adding into existing code it'd make sense to be a warning rather than crash the entire suite. Thanks :)