FscanF - reg. expressions?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
QWERTY
Forum Newbie
Posts: 20
Joined: Sat Jun 29, 2002 10:57 am
Location: Slovenia

FscanF - reg. expressions?

Post by QWERTY »

File.txt:

Code: Select all

something- something		something	some thing 
something- something		something	some thing 
something- something		something	some thing
Scan.php :

Code: Select all

while ($abc = fscanf ($fd , "%s\t%s\t%s\n" )){
list...
..... code continues ...

}
As you can see, file.txt contains some text, and there are some whitespaces in it. But (on 1st line) there is "something- something". Some text, than "-", whitespace, and again some text. Now i would like to select everything with %s, but it doesent work...
Anyone know the solution?

BTW: There is a way to put regular expressions in "search format", right? How?
Post Reply