Greetings!
I'm using the raintpl template engine. I'm parsing a file and trying ignore all empty lines and comment lines.
The if statement in the index file should be pretty understandable.
The issue i'm having is with the logical operator || OR.
If I have both of them inside the if statement (as in the code below), it returns true. However if i remove either one of them, it works fine.
How can I go about fixing this using the || OR method?
index file:
$explodeByReturn = explode("\n", $file);
foreach($explodeByReturn as $l) {
if(trim($l) != '' || substr(trim($l),0,2) != '//') {
//if((trim($l) != '') || (substr(trim($l),0,2) != '//')) { //ALSO TRIED THIS WITH SAME RESULT
$explodeByLine = explode('=', $l);
$tpl->assign(rtrim($explodeByLine[0]), ltrim($explodeByLine[1]));
}
}
lang_file
PAGE_TITLE = Test page
OK = OK
SUBMIT = SUBMIT
USERNAME = Username:
PASSWORD = Password:
MIN_CHARS_LOGIN = Minimum 6 Characters
LOGIN_SUBMIT = Login
//SOME COMMENT
MORE_VARS = test var