I want to put a validation for blank line.. the code I created read data from text file line by line using fgets.. I want to show the text "Not available" if there's a blank line... I tried the ff:
Code: Select all
if (empty($variable))
if ($variable==NULL)
if ($variable =="")
if ($variable =="\r\n")
though if ($variable =="\r\n") and if (empty($variable)) works, it replaces everything because all data have spaces, tabs, etc..... what if i only want to read "blank line" only?? (between name 3 and name 4)
(e.g. from text file)
name1
name2
name3
name4
can you give me an idea on this? thanks in advance.... any idea will be very much appreciated