How You – YES, YOU! – Can Supply Mom (Mutti Merkel) With a New Partner
We’ll try to create an automatic process to generate a government for Merry Old Germany. The given possible data are:
if
Mutti
try
Mutti-ESPEDE
else
Mutti-Grüne
Mutti-Linkspartei
Minderheitsregierung
Duldung
wechselnde Mehrheiten
Neuwahlen
In order to discard all scenarios which are obviously impossible, e. g. Mutti–Linkspartei, you must FILL the space between two bars with the unswallowable partner or a disallowed case/constellation:
|Linkspartei|Duldung|
ec. Also any punctuation mark like blank space ec.
Code:
<?php $government = 'Mutti-ESPEDE Grüne Linkspartei Minderheitsregierung Duldung wechselnde Mehrheiten Neuwahlen'; echo preg_replace('#(ESPEDE|Linkspartei|Minderheitsregierung|Duldung|wechselnde Mehrheiten|Neuwahlen|
|)#','', $government); ?>
This outputs the following: Mutti-Grüne