I am working on my REST client library for CodeIgniter and I am struggling to work out how to send PUT and DELETE arguments in PHP.
In a few places I have seen peopl
This is my version of the DELETE for CI. It accepts GET-style arguments for the DELETE, even same name arguments, i.e.: GET /some/url?id=1&id=2&id=3
protected function _parse_delete()
{
$query = $_SERVER['QUERY_STRING'];
if ( !empty( $query ) )
{
foreach( explode('&', $query ) as $param )
{
list($k, $v) = explode('=', $param);
$k = urldecode($k);
$v = urldecode($v);
if ( isset( $this->_delete_args[$k] ) )
{
if ( is_scalar( $this->_delete_args[$k] ) )
{
$this->_delete_args[$k] = array( $this->_delete_args[$k] );
}
$this->_delete_args[$k][] = $v ;
}
else
{
$this->_delete_args[$k] = $v;
}
}
}
}