ܻؤ1顪30奵꡼ޥܥ

ITȤƯ30奵꡼ޥΥ饤ߥ󥰵Ͽ

ƥꡧ PHP

http://phpcon.php.gr.jp/2009/

ǯ10ǯߤǤ

ǡֽ黲äο͡פȼ䤬äǤ
67οͤꤷƤ褦˻פޤ
ܤ⤽ΰͤǤ

äѤŪʤΤϡ


PHPȤϡ
ƥץ졼ȥ󥸥󳦤ΥСƥΥ
ǽƥƥץ졼ȥ󥸥ǥƥץ졼ȥ󥸥



θդǤ礦
֤ξФƤޤ
ȯɽ򤷤moriyoshiΡPHP ֤ݤ 10 ˡפ
PHP¤䡢CΥɤ򤤤äƿؿɲäʤ
( ϡ)ġ ͎͎͎͎͎äƤ󤸤ơ


äȥᥤǸƤޤΤǡ
FacebookBrian ShireΡAPCˤϥѥեޥ󥹤μ¸ס
ƣʹ𤵤ΡCakePHPȡ꡼
SymfonyȯFabien PotencierΡSymfony, a web framework for professional websites
ʤɤʤɤ򸫤Ƥޤ

Υե졼ΨCakePHP > Symfony > ¾ߤʡ
ץ쥼⤽줾Υե졼ξҲߤʤ󤸤äΤǤäȥ


ȤɤäȤäƤߤ褦ʤǾƵäƤޤ
    Υȥ꡼ϤƤʥ֥åޡɲ

ȸ 21 Really Useful & Handy PHP Code Snippets
if(!emptyempty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){  
 //If AJAX Request Then  
}else{  
 //something else  
} 
    Υȥ꡼ϤƤʥ֥åޡɲ

5ގَ
äAmazon᡼ƤΤбƤߤޤ
꤮ˤʤʤȤʤ
Ƶ٤ߤνȤäǤ

Ȥ櫓ǺޤϤƤparamȥåȥϤ
URL֤Ƥؿ

˼ʬѡ
֤ͤϤѤȤ͡

function amazonSignature ($param=array(), $secretKey="") {
  $aws = array("host" => "webservices.amazon.co.jp", "path" => "/onca/xml");
  ksort($param);

  $reqParam = array();
  foreach ($param as $key => $val) {
    $reqParam[] = $key . "=" . rawurlencode($val);
  }

  $paramStr = implode("&", $reqParam);
  $str = implode("\n", array('GET', $aws["host"], $aws["path"], $paramStr));
  $sig = rawurlencode( base64_encode( hash_hmac("sha256", $str, $secretKey, true)));
  $reqParam[] = "Signature=" . $sig;
  $url = "http://" . $aws["host"]. $aws["path"] . "?" . implode("&", $reqParam);

  return $url;
}

ʤߤparamˤϤʴΥǡ
ˤ碌ѹ
$param = array(
               "Service" => "AWSECommerceService",
               "AWSAccessKeyId" => "YOUR ACCESS KEY",
               "Operation" => "ItemSearch",
               "SearchIndex" => "Books",
               "ResponseGroup" => "Medium,Tracks",
               "BrowseNode" => "465610",
               "Timestamp" => gmdate("Y-m-d\TH:i:s\Z"),
               );
    Υȥ꡼ϤƤʥ֥åޡɲ

ΥڡΥȥåץ