Last active
July 12, 2019 22:02
-
-
Save parzibyte/58bc289d5b023bbb945e7b80b670130c to your computer and use it in GitHub Desktop.
This file contains 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 | |
/* | |
Separar cadena usando delimitadores en PHP | |
https://parzibyte.me/blog | |
*/ | |
$cadena = "Blue Jean | |
The Jean Genie | |
Stray Cat Strut | |
Fashion | |
Rock this town"; | |
$separador = "\n"; // Usar salto de línea | |
$separada = explode($separador, $cadena); | |
var_dump($separada); | |
/* | |
Salida: | |
array(5) { | |
[0]=> | |
string(9) "Blue Jean" | |
[1]=> | |
string(14) "The Jean Genie" | |
[2]=> | |
string(15) "Stray Cat Strut" | |
[3]=> | |
string(7) "Fashion" | |
[4]=> | |
string(14) "Rock this town" | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment