Skip to content

Instantly share code, notes, and snippets.

@pierrealexaline
Created October 11, 2018 15:06
Show Gist options
  • Select an option

  • Save pierrealexaline/728ecb4017c9f0a70a9fccb7d339e81b to your computer and use it in GitHub Desktop.

Select an option

Save pierrealexaline/728ecb4017c9f0a70a9fccb7d339e81b to your computer and use it in GitHub Desktop.
travail sur les chaînes en php
<?php
$chaines[0] = "0@sn9sirppa@#?ia'jgtvryko1";
$chaines[1] = "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj";
$chaines[2] = "aopi?sgnirts@#?sedhtg+p9l!";
foreach ($chaines as $key=>$value)
{
$longuerChaine = strlen($value)/2;
$sousChaines = substr($value, 5,$longuerChaine);
$sousChaine = str_replace('@#?'," ",$sousChaines);
$sousChaine = strrev($sousChaine);
echo $sousChaine . " ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment