I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
Tror ikke jeg kan bruge den løsning, da "mangen, konen, drengen" er total tilfældig. En bruger kan vælge nogle tilfældige ord i hans signatur, og lave dem om til noget andet.
<?php //$string = file_get_contents('words.txt'); $string = 'The little [boy|man] took his [cycle|bike|vehicle] for a [ride|spin|drive]'; preg_match_all('~\[([^\]]*)\]~',$string,$matches); foreach($matches[1] as $m) { $choice = explode('|',$m); shuffle($choice); $rep[] = $choice[0]; } foreach ($rep as $r) { $string = preg_replace('~\[[^\]]*\]~',$r,$string,1); } echo $string; ?>
<?php $string = 'The little [boy|man] took his [cycle|bike|vehicle] for a [ride|spin|drive]'; preg_match_all('~\[([^\]]*)\]~',$string,$matches); print preg_replace_callback( '|\[(.*?)\]|', create_function('$m','$c = explode("|",$m[1]);shuffle($c);return $c[0];' ), $string); ?>
<?php $string = 'The little [boy|man] took his [cycle|bike|vehicle] for a [ride|spin|drive]'; print preg_replace_callback( '|\[(.*?)\]|', create_function('$m','$c = explode("|",$m[1]);shuffle($c);return $c[0];' ), $string); ?>
Og med lidt mindre arbejde for serveren (ingen grund til at bytte om på alle elementer i et array, bare for at få et tilfældigt):
<?php $string = 'The little [boy|man] took his [cycle|bike|vehicle] for a [ride|spin|drive]'; print preg_replace_callback( '|\[(.*?)\]|', create_function('$m','$c = explode("|",$m[1]);return $c[array_rand($c)];' ), $string); ?>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.