Returns the sequence number and position of the array $ arr & nbsp; array & nbsp; (& nbsp; 0 & nbsp; & gt; & nbsp; & nbsp; array & nbsp; (& nbsp; 0 & nbsp; & gt; & nbsp; SU14031300617, & nbsp; & nbsp; p solves the array sequence number and position
$arr = array (
0 =>
array (
0 => 'SU14031300617',
'po_num' => 'SU14031300617',
),
1 =>
array (
0 => 'SU14031300623',
'po_num' => 'SU14031300623',
),
2 =>
array (
0 => 'SU14031300626',
'po_num' => 'SU14031300626',
),
3 =>
array (
0 => 'SU14031300627',
'po_num' => 'SU14031300627',
),
4 =>
array (
0 => 'SU14031300616',
'po_num' => 'SU14031300616',
),
5 =>
array (
0 => 'SU14031300618',
'po_num' => 'SU14031300618',
),
6 =>
array (
0 => 'SU14031300622',
'po_num' => 'SU14031300622',
),
7 =>
array (
0 => 'SU14031300624',
'po_num' => 'SU14031300624',
),
8 =>
array (
0 => 'SU14031300625',
'po_num' => 'SU14031300625',
),
)
Suppose SU14031300617, the position of the array is 1st of the 8 items, expressed as 1/8, which can be obtained through the serial number. How can I solve this problem?
------ Solution --------------------
foreach($arr as $k=>$tmp) {
if('SU14031300617' == $tmp[0]) {
return ($k+1) . '/' . count($arr);
}
}
return false;