-
-
Save parzibyte/5047ae48373d698e9551587f7e79667d 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 = "Hola mundo-Soy otra oración-Me gusta PHP"; | |
$separador = "-"; | |
$separada = explode($separador, $cadena); | |
var_dump($separada); | |
/* | |
Salida: | |
array(3) { | |
[0]=> | |
string(10) "Hola mundo" | |
[1]=> | |
string(17) "Soy otra oración" | |
[2]=> | |
string(12) "Me gusta PHP" | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment