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

58
Vistas
php sees a variable but cannot handle with it

trying to get window width on server side

$w = "<script>document.write(screen.width);</script>";
echo $w;  // 1600
echo '<br>' . gettype($w); // string

now I need an integer instead the string
tried a lot of ways from here

for example

$w = intval($w);  
$w = (int) $w; 
settype($w, "integer"); 

echo $w;  // 0
echo '<br>' . gettype($w);  // integer  

so result is allways 0 and integer

how to explain - php sees the variable but cannot handle with it ?
and how can I get 1600-integer

about 4 years ago · Juan Pablo Isaza
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