Php function array_merge () usage example (merging similar arrays)
- $ Arr1 = $ dblink-> mem_fetch_array ("SELECT t_pid, imgname, sorted Ted, score FROM 't_ sum_giftimg 'where t_pid = 3 or t_pid = 6", 0 );
- $ Arr2 = $ dblink-> mem_fetch_array ("SELECT t_pid, imgname, sorted Ted, score FROM 't_ sum_giftimg 'where t_pid = 10 or t_pid = 12", 0 );
- $ ImgInfo = array_merge ($ arr1, $ arr2 );
- If ($ imgInfo ){
- Foreach ($ imgInfo as $ imgInfo ){
- $ Imgs [] = $ imgInfo;
- }
- }
Articles that you may be interested in: Introduction to the php method for creating arrays. php uses array_unique to determine whether the same value exists in the array. php array function in_array () queries whether the specified value of the php array function array_key_exists () exists in the array () small example of checking whether the array key name contains php array deduplication small example of php array and loop small example enhanced version of the array_unique function (supports two-dimensional array) php array callback filter function array_filter () application instance php extract variable functions from the array and application instances randomly extract some elements from the array php code use php array to automatically add links to the article content php add and delete arrays element method |