Skip to content

Instantly share code, notes, and snippets.

@yoander
Last active July 22, 2018 22:20
Show Gist options
  • Save yoander/dc8f02ce4bae7b8f027e0f67864ae3dd to your computer and use it in GitHub Desktop.
Save yoander/dc8f02ce4bae7b8f027e0f67864ae3dd to your computer and use it in GitHub Desktop.
<?php
var_dump("abcdef"[-2]); // Print: string (1) "e"
var_dump(strpos("aabbcc", "b", -3)); // Print: int(3)
$string = 'bar';
echo "El último carácter de '$string' es '$string[-1]'.\n";
// Print: El último carácter de 'bar' is 'r'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment