-
-
Save parzibyte/c665835f8e966d91ec071317b5e1160d 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 | |
/* | |
Cadena a arreglo en PHP | |
https://parzibyte.me/blog | |
*/ | |
$cadena = "Hola mundo me gusta PHP"; | |
$separador = " "; // Usar espacio como separador | |
$arreglo = explode($separador, $cadena); | |
var_dump($arreglo); | |
/* | |
Salida: | |
array(5) { | |
[0]=> | |
string(4) "Hola" | |
[1]=> | |
string(5) "mundo" | |
[2]=> | |
string(2) "me" | |
[3]=> | |
string(5) "gusta" | |
[4]=> | |
string(3) "PHP" | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment