sscanf and fscanf

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
joesmoh
Forum Newbie
Posts: 6
Joined: Wed Sep 03, 2003 12:30 pm

sscanf and fscanf

Post by joesmoh »

Hey,

I am having trouble using the fscanf. First, I am trying to take a bunch of webpages and take specific data such as the title, email address, author, and texts and put it into a database. If anyone has any better way to do this, please tell.

So, I have this sscanf which returns title into $first and 1 for $somevalue
$somevalue = sscanf("<CENTER><B><FONT SIZE=+3>
title
</FONT></B></CENTER>",
"<CENTER><B><FONT SIZE=+3>
%s
</FONT></B></CENTER>", &$first)";

Now, I put that header into file.htm and run it through fscanf:

$openedfile = fopen("file.htm", r);
$somevalue = fscanf($openedfile,
"<CENTER><B><FONT SIZE=+3>
%s
</FONT></B></CENTER>", &$first)";
oddly, this returns nothing in $first and fscanf returns -1
joesmoh
Forum Newbie
Posts: 6
Joined: Wed Sep 03, 2003 12:30 pm

Post by joesmoh »

hmmm...
well anyone know a better way than fscanf then?

:-)
Post Reply