Created
October 11, 2018 15:06
-
-
Save pierrealexaline/728ecb4017c9f0a70a9fccb7d339e81b to your computer and use it in GitHub Desktop.
travail sur les chaînes en php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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