arrays - PHP error suppression or isset -


i have array of more 50 indefinite keys means not sure 1 particular field there or not. have 2 option assign array values other.

first

 $array2['someothefield'] = isset($array1['somefield'])?$array1['somefield']:null; 

second

 $array2['someotherfield'] = @ $array1['somefield']; 

can please suggest ,which 1 better case. or, there way can suppress errors 1 block of code .

if need code fast, second option better due experience profiling php code.

if going 50 elements, use first option, because it's clear kind of problem trying avoid.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -