[ create a new paste ] login | about

Link: http://codepad.org/duv3AeXE    [ raw code | output | fork ]

PHP, pasted on Jun 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

	for($i=0; $i<16; $i++){

		$phrases = array('Hello Sailor','Acid Test','Bear Garden','Botch A Job','Dark Horse',
		        'In The Red','Man Up','Pan Out','Quid Pro Quo','Rub It In','Turncoat',
		        'Yes Man','All Wet','Bag Lady','Bean Feast','Big Wig');

		        echo "Count of array before remove: ".count($phrases)."\r\n";
		        $rand_phrase = array_rand($phrases);
		        $rand_phrase_value = $phrases[$rand_phrase];
		        unset($phrases[$rand_phrase]);        
		        echo "Count of array after remove: ".count($phrases)."\r\n";


	}

?>


Output:
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15
Count of array before remove: 16
Count of array after remove: 15


Create a new paste based on this one


Comments: