{"type":"rich","version":"1.0","provider_name":"phorkie","provider_url":"https:\/\/p.cweiske.de\/","title":"PHP: combine values of two arrays, alternating","author_name":"Christian Weiske","cache_age":86400,"width":900,"height":900,"html":"<!-- embedding all files of https:\/\/p.cweiske.de\/854 -->\n<link rel=\"stylesheet\" href=\"https:\/\/p.cweiske.de\/css\/embed.css\"\/>\n<div class=\"phork\" id=\"854\">\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  \n<div class=\"document\">\n\n\n<p>Inspiration: <a class=\"reference external\" href=\"https:\/\/stackoverflow.com\/q\/11827451\/282601\">https:\/\/stackoverflow.com\/q\/11827451\/282601<\/a><\/p>\n<\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/854\/rev-raw\/bc456b000d02f96d094b41dd0f3f14df2a481fb7\/README.rst\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/854#README.rst\">README.rst<\/a>\n <\/div>\n<\/div>\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  <style type=\"text\/css\">\/**\n * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2014 Benny Baumann\n * (http:\/\/qbnz.com\/highlighter\/ and http:\/\/geshi.org\/)\n *\/\n.php .de1, .php .de2 {font: normal normal 1em\/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}\n.php  {font-family:monospace;}\n.php .imp {font-weight: bold; color: red;}\n.php li, .php .li1 {color: #DDD;}\n.php .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}\n.php .kw1 {color: #b1b100;}\n.php .kw2 {color: #000000; font-weight: bold;}\n.php .kw3 {color: #990000;}\n.php .kw4 {color: #009900; font-weight: bold;}\n.php .co1 {color: #666666; font-style: italic;}\n.php .co2 {color: #666666; font-style: italic;}\n.php .co3 {color: #0000cc; font-style: italic;}\n.php .co4 {color: #009933; font-style: italic;}\n.php .coMULTI {color: #666666; font-style: italic;}\n.php .es0 {color: #000099; font-weight: bold;}\n.php .es1 {color: #000099; font-weight: bold;}\n.php .es2 {color: #660099; font-weight: bold;}\n.php .es3 {color: #660099; font-weight: bold;}\n.php .es4 {color: #006699; font-weight: bold;}\n.php .es5 {color: #006699; font-weight: bold; font-style: italic;}\n.php .es6 {color: #009933; font-weight: bold;}\n.php .es_h {color: #000099; font-weight: bold;}\n.php .br0 {color: #009900;}\n.php .sy0 {color: #339933;}\n.php .sy1 {color: #000000; font-weight: bold;}\n.php .st0 {color: #0000ff;}\n.php .st_h {color: #0000ff;}\n.php .nu0 {color: #cc66cc;}\n.php .nu8 {color: #208080;}\n.php .nu12 {color: #208080;}\n.php .nu19 {color:#800080;}\n.php .me1 {color: #004000;}\n.php .me2 {color: #004000;}\n.php .re0 {color: #000088;}\n.php span.xtra { display:block; }\n<\/style><div class=\"code\"><table class=\"php\"><tbody><tr class=\"li1\"><td class=\"ln\"><pre class=\"de1\">1\n2\n3\n4\n5\n6\n7\n<\/pre><\/td><td class=\"de1\"><pre class=\"de1\"><span class=\"kw2\">&lt;?php<\/span>\n<span class=\"re0\">$a<\/span> <span class=\"sy0\">=<\/span> <span class=\"br0\">&#91;<\/span><span class=\"st_h\">'a1'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'a2'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'a3'<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">;<\/span>\n<span class=\"re0\">$b<\/span> <span class=\"sy0\">=<\/span> <span class=\"br0\">&#91;<\/span><span class=\"st_h\">'b1'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'b2'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'b3'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'b4'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'b5'<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">;<\/span>\n<span class=\"re0\">$combo<\/span> <span class=\"sy0\">=<\/span> <a href=\"http:\/\/www.php.net\/array_filter\"><span class=\"kw3\">array_filter<\/span><\/a><span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array_merge\"><span class=\"kw3\">array_merge<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"sy0\">...<\/span><a href=\"http:\/\/www.php.net\/array_map\"><span class=\"kw3\">array_map<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"kw4\">null<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$a<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$b<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span>\n&#160;\n<a href=\"http:\/\/www.php.net\/var_dump\"><span class=\"kw3\">var_dump<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"re0\">$combo<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span>\n&#160;<\/pre><\/td><\/tr><\/tbody><\/table><\/div>\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/854\/rev-raw\/bc456b000d02f96d094b41dd0f3f14df2a481fb7\/code.php\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/854#code.php\">code.php<\/a>\n <\/div>\n<\/div>\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  <div class=\"code\"><pre class=\"txt\">array(8) {\r\n  [0]=&gt;  string(2) &quot;a1&quot;\r\n  [1]=&gt;  string(2) &quot;b1&quot;\r\n  [2]=&gt;  string(2) &quot;a2&quot;\r\n  [3]=&gt;  string(2) &quot;b2&quot;\r\n  [4]=&gt;  string(2) &quot;a3&quot;\r\n  [5]=&gt;  string(2) &quot;b3&quot;\r\n  [7]=&gt;  string(2) &quot;b4&quot;\r\n  [9]=&gt;  string(2) &quot;b5&quot;\r\n}<\/pre><\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/854\/rev-raw\/bc456b000d02f96d094b41dd0f3f14df2a481fb7\/output.txt\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/854#output.txt\">output.txt<\/a>\n <\/div>\n<\/div>\n<\/div>\n"}
