Cual es el equivalente php de esta función javascript

  • Autor Autor xaiborweb
  • Fecha de inicio Fecha de inicio
xaiborweb

xaiborweb

Programador
No recomendado
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
hola colegas de forobeta

necesito pasar esta función a php
HTML:
function readgetF() {
    if (!getFStr) return END_OF_INPUT;
    if (getFCount >= getFStr.length) return END_OF_INPUT;
    var e = getFStr.charCodeAt(getFCount) & 255;
    getFCount++;
    return e
}

pero no se cual es su equivalente php, alguien lo sabe ?
 
Hola,

¿Qué es lo que hace esa función exactamente? Tal vez así pueda ayudarte.

Saludos,
 
Siendo $getFStr y $getFCoun variables globales y END_OF_INPUT una constante, sería algo como esto:
PHP:
<?php
function readgetF()
{
    global $getFCount, $getFStr;

    if (!$getFStr) {
        return END_OF_INPUT;
    }

    if ($getFCount >= strlen($getFStr)) {
        return END_OF_INPUT;
    }

    return ord($getFStr[$getFCount++]);
}

Saludos.
 
Atrás
Arriba