1
2<?php
3$yes = array('this', 'is', 'an array');
4
5echo is_array($yes) ? 'Array' : 'not an Array';
6echo "\n";
7
8$no = 'this is a string';
9
10echo is_array($no) ? 'Array' : 'not an Array';
11?>
12
13
1$id = 1;
2$age = 2;
3$sort = "id"; // or "age";
4 $Key = $$sort;
5$arr = array($Key => 'string');
6
7print_r($arr);
1$arr = 'This is not array only string';
2
3if ( is_array($arr)) {
4 echo 'Available';
5}