Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/04/2013, 12:38
Avatar de andresdzphp
andresdzphp
Colaborador
 
Fecha de Ingreso: julio-2011
Ubicación: $this->Colombia;
Mensajes: 2.749
Antigüedad: 12 años, 9 meses
Puntos: 793
Respuesta: separar caracteres de ancho fijo

Creo que entendí algo así:

Código PHP:
Ver original
  1. $str = '789382100011';
  2.  
  3. $factura = substr($str, 0, 4);
  4. $sucursal = substr($str, 4, 2);

Consulta las funciones de string:

http://www.php.net/manual/es/ref.strings.php
__________________
Si sabemos como leer e interpretar el manual será mucho más fácil aprender PHP. En lugar de confiar en ejemplos o copiar y pegar - PHP