[ create a new paste ] login | about

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

mcgrailm - PHP, pasted on May 5:
<?php
$SchoolNames = Array(10003, "Southwestern College", "National University", "Western Governors University", "Southwestern College Admissions Center - Evaluations Dept");
$data = array(
	0 =>  Array(
		'STU_MANG_fname' => "Jennifer",
		'STU_MANG_lname' => "patel",
		'SchoolName' => "Southwestern College Admissions Center - Evaluations Dept",
		'ShipAddress1' => "900 Otay Lakes Road",
		'ShipState' => "CALIFORNIA" 
	)
);
					

foreach($data as $studen_info){
	foreach($SchoolNames as $id=>$school_name){
		if($studen_info['SchoolName'] == $school_name){
			$student_names[$school_name] = $id;
		}
	}
}

print_r($student_names);
?>


Output:
1
2
3
4
Array
(
    [Southwestern College Admissions Center - Evaluations Dept] => 4
)


Create a new paste based on this one


Comments: