2007年1月30日火曜日

get and post

1.get
send link data ( typically search data) to WEB server

php:
send url with "get data" like "test.php?id=11" .

2.post
form data .it also send picture data .

case of PHP :
script must be started with "extract($_POST)" to extract.
script must be started with "extract($_GET)" to extract.

download

$downloadfile = "data.csv";
header("Content-Disposition: attachment; filename=$downloadfile");
header("Content-type: application/octet-stream; name=$downloadfile");
$result = file_get_contents("test.data");
print $result;

merge for array

there is 2 way to merge for array:

1) use '+'
2) use array_merge()

--
what different is ;
1) '+' is not overwrite on same key
2) array_merge does overwrite

quat strings

it possible to use both " and ' to quat strings .but ' is more use full when you want to write "html codes" .because "html code" often include " .
--
Using " inseide string quat ,pur \ before string.

配列のポインタ

pointar is resetted for "forearch"
--
pointar is not resetted for "while" and "list"

参考演算子

$変数 = (条件式)? 値1 : 値2 ;

--
same as :

if(条件式)
$変数 = 値1 ;
else
$変数 = 値2 ;
end