Kirill
Новичок
сессии & ссылки
test.php
пробуем
- test.php?type=1:
- test.php
Вопрос почему в первом случае int, во втором случае &int ?
test.php
Код:
<?php
session_name('test');
session_start();
print '<pre>';
var_dump($_SESSION);
print '</pre>';
if(isset($_GET['type'])){
$type = intval($_GET['type']);
$_SESSION['type'] = $type;
}
else{
$type = intval($_SESSION['type']);
}
print '<pre>';
var_dump($_SESSION);
print '</pre>';
?>
- test.php?type=1:
Код:
array(0) {
}
array(1) {
["type"]=>
int(1)
}
Код:
array(1) {
["type"]=>
&int(1)
}
array(1) {
["type"]=>
&int(1)
}