[ create a new paste ] login | about

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

PHP, pasted on Nov 6:
<?php
	$products = array(
		'CATEGORY' =>
		array(
			'book' =>
			array(
				0 =>
				array(
					'DESCRIPTION' => 'Bar',
				),
				1 =>
				array(
					'DESCRIPTION' => 'sdfadasfdasfas',
				),
			),
			'desk' =>
			array(
				0 =>
				array(
					'DESCRIPTION' => 'Barrrr',
				),
			),
		),
	);

	$cat_to_index = '';

	foreach (array_values(array_unique($products['CATEGORY'])) as $category => $uniq_cat) {
		for($i=array_search($uniq_cat, $products['CATEGORY']);
			$i!==FALSE; $i=array_search($uniq_cat, $products['CATEGORY']))
				$cat_to_index .= $i; // just for debugging
	}
?>


Output:
1
Timeout


Create a new paste based on this one


Comments: