Skip to content

Instantly share code, notes, and snippets.

@ethertank
Created March 12, 2012 12:59
Show Gist options
  • Save ethertank/2021683 to your computer and use it in GitHub Desktop.
Save ethertank/2021683 to your computer and use it in GitHub Desktop.
ダミーのjsonを出力するphp
<?php
$len = 5;
$jsonArray = array();
$bodyStr = "。";
for($i = 0; $i < 10; $i++){
$bodyStr = "仲村みう".$bodyStr;
}
for($i = 1, $l = $len + 1; $i < $l; $i++){
$jsonArray[] = array(
"entry-title" => "仲村みうラスト写真集 ".$i,
"entry-body" => $bodyStr
);
}
header( 'Content-Type: text/javascript' );
$json = json_encode( $jsonArray );
echo $json;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment