I have array with alphanumeric key values..While filling array on particular condition I have filled array key with empty word. Now I want if on key empty is arises array should be increment with one position, so that that value is not stored in db. Simply want to skip that key and move to next.
foreach( $inputs as $key => $value) {
if(key($inputs)=="empty"){ $inputs[]++; }
else{ echo "<strong>$key</strong> Singer <strong>$value</strong></br>";
//INSERT Query; }
}
For deleting elements for an array use:
For skipping, perhaps the most obvious is:
Note: you can insert multiple rows with one query, it might be better to do that.. build an array containing the rows “(value1,value2,…)” and use
implode