I'm uploading generic files with php, I read the first line of the uploaded file to validate (which is equals to $line2
).
$line = file($target_file)[0];
$line2 = 'S01700006275696C642F697269732F6D61696E2E7372656343 ';
echo $line;
echo "<br>";
echo $line2;
if($line === $line2){
echo "<br>true";
}else{
echo "<br>false";}
Checking my outputs, I discovered theres an extra space in $line
(Although there's no extra space on the file), So I added that extra space to $line2.
Problem is it always returns false
. I have tried:
if($line == $line2)
as well as
if(strcmp($line,$line2)==0)
Obviously I tried removing the extra space from $line2