Match $var in text file ?
Posted: Wed Jul 01, 2009 12:05 pm
Good day to you all,
stupid as it sound, all the thing that I have tried to match a variable into a text file and execute according to it result.
Thanks !
stupid as it sound, all the thing that I have tried to match a variable into a text file and execute according to it result.
Code: Select all
$active = "user_list.txt";
$pos = strpos($active, $_SESSION['username']);
if ($pos === false) {
echo "<b id=\"userinfo\"><img src=\"enligne.png\" valign=\"bottom\" width=\"13px\"/></b>";
} else {
echo "<b id=\"userinfo\"><img src=\"horsligne.png\" valign=\"bottom\" width=\"13px\"/></b>";
}
Thanks !