Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/07/2017, 21:35
xoceunder
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 10 meses
Puntos: 10
duda en comprobar array con valor

hola es que quiero ver si es posible comprobar valor en un array para cambiar su estructura si no existe en el array pues coloque su valor original

tengo esto echo

Código PHP:
Ver original
  1. $valor = "3100X";
  2. $Find = array("5000X","6000X","7000X","3600X","3700X","3710X","4620X","4630X","4640X","2400X","3000X","3050X","3100X","2450X","2500X","3400X","3420X","4200X","2700X","2710X","2720X","3500X","4210X","4230X","4400X","N1000","N1050","N1100","N1101","2000C","2050X","2050N","2100X","2100N");
  3. $Replace = array("Roku TV","4K Roku TV","4K Roku TV","Roku Streaming Stick","Roku Express","Roku Express Plus","Roku Premiere","Roku Premier Plus","Roku Ultra","Roku LT","Roku 2 HD","Roku 2 XD","Roku 2 XS","Roku LT","Roku HD","Roku Streaming Stick","Roku Streaming Stick","Roku 3","Roku LT","Roku 1","Roku 2","Roku Streaming Stick","Roku 2","Roku 3","Roku 4","Roku HD Classic","Roku SD","Roku HD Classic","Roku XD|S Classic","Roku HD","Roku XD","Roku XD","Roku XD|S","Roku XD|S");
  4. echo strtr($valor,array_combine($Find, $Replace));