Joined October 2012
·

David Godfrey

PHP Developer at Coolpink
·
Yorkshire, UK
·
·
·

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 :)

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,327 Total ProTip Views