Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $set = isset($_GET['id']) ? $_GET['id'] : 1;
- $users = array(
- 1 => array(
- 'name' => 'dan',
- 'age' => 14,
- 'country' => 'england',
- ),
- 2 => array(
- 'name' => 'josh',
- 'age' => 17,
- 'country' => 'australlia',
- ),
- );
- if(isset($users[$set]))
- {
- $user = $users[$set];
- }
- else
- {
- die("<b>Warning:</b> A user with the ID ".$set." Does not exist!");
- }
- echo 'My name is ' . ucwords($user['name']) . ', i am ' . $user['age'] . ' Year\'s old, i am from ' . ucwords($user['country']) . ' and my user ID is ' . $set;
- echo '<br /><br /><h1>All Users:</h1><br />';
- echo '<xmp>$users = ' . print_r($users,true) . '</xmp>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement