<h1>function</h1>
<?php
header("Content-Type: text/html; charset=UTF-8");
$adata = array('a', 'b', 'c');
array_push($adata,'d');
foreach($adata as $item){
echo $item."<br />";
}
var_dump(count($adata));
?>
<h1>oop</h1>
<?php
$odata = new ArrayObject(['a', 'b', 'c']);
$odata->append('d');
foreach($odata as $vals){
echo $vals."<br />";
}
var_dump($odata->count());
?>
'PHP > PHP함수' 카테고리의 다른 글
in_array, array_key_exists (0) | 2017.11.25 |
---|---|
strpos(),strrpos()와 strstr(),strrchr() 함수이용 (0) | 2017.11.25 |
is_file, is_dir, file_get_contents, file_put_content, isFile, isDir, fread, fwrite (0) | 2017.11.24 |
strrev() Function (0) | 2017.11.17 |
is_resource() (0) | 2017.11.17 |