Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
string array to array of word

i have data in my mysql database "Service,House Worker" (without ""), when i access my data from the database i found (Service,House Worker) as it is, when i try to convert with (var_dump(explode(',',($CheckBoxAnswer)));) it then its return following :

array(1) { [0]=> string(26) "Service,House Worker" }

but i want something similar:

array(1)
(
    [0] => string(7) "Service"
    [1] => string(13) "House Worker"
)

$CheckBoxAnswer is contain data i pulled from mysql. i tried with var_dump(explode(',',($CheckBoxAnswer))); but its not working

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Try this:

  var_dump(explode(',',($CheckBoxAnswer[0])));

You are tring to explode an array into an another array. You need to specify the string instead.

over 4 years ago · Santiago Trujillo Denunciar

0

First you need to trim $CheckBoxAnswer

Because by using var_dump giving string length 26 instead of 20

Then after use string replace

str_replace('/','',$CheckBoxAnswer);

After that try to use var_dump(explode(',',($CheckBoxAnswer)));

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda