Skip to content

Instantly share code, notes, and snippets.

@Chojiu15
Created October 17, 2018 09:24
Show Gist options
  • Save Chojiu15/2ce3389893fba07bfc50de9d854e12fc to your computer and use it in GitHub Desktop.
Save Chojiu15/2ce3389893fba07bfc50de9d854e12fc to your computer and use it in GitHub Desktop.
Chaînes de caractères
<?php
$first_message = "0@sn9sirppa@#?ia'jgtvryko1";
$divide1 = strlen($first_message);
$key_divide1 = 5;
$key_divide2 = $divide1 / 2;
$first_modif = substr($first_message, $key_divide1, $key_divide2);
echo $first_modif;
$second_modif = str_replace('@#?', ' ', $first_modif);
echo $second_modif;
echo '<br>';
echo strrev($second_modif);
-j'ai appris
-toutes les ficelles
-des strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment