Foros del Web » Programando para Internet » PHP »

Compiler: A Split() problem

Estas en el tema de Compiler: A Split() problem en el foro de PHP en Foros del Web. Hi! I've been doing a little project lately about a compiler, and it works in the following way: You specify a .txt file and it ...
  #1 (permalink)  
Antiguo 19/09/2006, 11:52
 
Fecha de Ingreso: febrero-2005
Mensajes: 97
Antigüedad: 19 años, 2 meses
Puntos: 0
Mensaje Compiler: A Split() problem

Hi!

I've been doing a little project lately about a compiler, and it works in the following way:
You specify a .txt file and it reads it using a split function for all the document.

So, First i've this variable $varElementsArray that represents all the txt file. Secondly i make the split
$varElementsArray = split('[/_._¿_?_ _;_&_+_-_*_,]', $text);

Where i'm dividing the txt into slashes dots Question marks Semicolon Ampersand Plus Minus Asterisk and Commas it works perfect! But when i try to use the single quote, double quotes, spacelines \n and brackets() it doesn't work.

My objective is to separate the whole text into those symbols so after that i can read every splited variable separated and read my code.
That's the way i think this compiler should work, if there's a better way to do it I would like to learn it

Thanks!!
__________________

www.bre4k.com
motion graphics

  #2 (permalink)  
Antiguo 19/09/2006, 21:04
 
Fecha de Ingreso: febrero-2005
Mensajes: 97
Antigüedad: 19 años, 2 meses
Puntos: 0
.

Trabajo con un compilador
Tengo una variable $varElementsArray que saca un texto de un txt. Luego le aplico un split para que me separe la variable dependiendo de varios simbolos. Slashes puntos signos de interrogacion espacios punto y comas ampersands mas menos signos de multiplicacion y comas
$varElementsArray = split('[/_._¿_?_ _;_&_+_-_*_,]', $text);

La cosa me falla cuando trato de meterle tambien las comillas simples, las normales, saltos de linea y parentesis. Esto lo hago para despues pueda leer cada punto del array generado y verificar si hay lexemas en el varElementsArray

Gracias!
__________________

www.bre4k.com
motion graphics

Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:07.