如何劈开一组数字中的4与7
例如一组数字:3655448674
需要避开这组数字中的4与7,遇到则++
<br />$strMaxcardid=3655448674;<br />$ar = str_split($strMaxcardid);<br /><br /> foreach($ar as $k => $v) {<br /> <br /> if ($v == 4 || $v == 7) { <br /> $ar[$v] ++; <br /> break; <br /> }}<br /> $str = join('', $ar);<br /> echo $str;*/<br />
$strMaxcardid=3655448674;<br />$ar = str_split($strMaxcardid);<br /> <br />foreach($ar as $k => $v) {<br /> if ($v == 4 <br><font color='#FF8000'>------解决思路----------------------</font><br> $v == 7) { <br /> $ar[$k] ++; <br /> }<br />}<br />$str = join('', $ar);<br />echo $str;