i have a file that have inside [abc] some=>text [def] another=>text [ghi] again=>text, and im trying to put only the result of [def] another=>text and [ghi] again=>text; i tried with preg_match_all bu i only get [def] and [ghi] but no another=>text etc

theskillwithin

ok I think I got it working, but I think I need to make a validation test because sometiems I get error http://pastie.org/10297344

xochilpili is there any way you could get [abc] some=>text on the same line?

xochilpili

sorabji, is a file from other software made it by someone elsetheskillwithin, im going to post my test.php file

theskillwithin

if you could get them on the same line, maybe you could explode by newlineor consider instead of pregmatch, use preg replace "" to delete any data u dont wantsorabji I think I need to make a validation test because 'sometiems' I get error http://pastie.org/10297344

well ur problem was that the pregmatch wasnt getting the line below it right?xochilpili I would try stripping out the newlines somehow http://php.net/manual/en/function.trim.phpthen var_dump that data and see if you can use ur regex on thatit would be neat if you could strip out the newlines in such a way that each [abc] blah=>blah was on its own line insetad of 2 lines

xochilpili

theskillwithin, yes, i can't get the line below

theskillwithin

then if you can do my seggestion it will work way better

xochilpili

theskillwithin, i did not understand

theskillwithin

your data looks like this:[abc]text=>textmake it look like this:[abc] text=>textsee 1 line

strip out all newlinesthen before each [ add a newlineu dont do it to the file, u do it to the variable you loaded ur file into...does anyone know how to validate line 2 & 3 so I stop getting notices? http://pastie.org/10297344if line 2 or 3 is non object then or something