Hi there, i am attempting to manipulate a string. However, when i use the line:
$line=fgets($info,1024);
I am getting the error:
Warning: Supplied argument is not a valid File-Handle resource in /home/public_html/test.php on line 37
Any ideas why this might be happening? the syntax looks right to me!
Any help would be greatly appreciated!!!!
$line=fgets($info,1024);
Moderator: General Moderators
Basically its a parser, it takes a BibTex format from a text box and passes it into my function, but i am passing it as a variable not a file- do you know how to turn the contents of a text box box into a file to pass? or is there a version of fgets() for vairables?
AS you can tell I am extremely new to this and trying to adapt someone elses code!
thanks for ur help!
AS you can tell I am extremely new to this and trying to adapt someone elses code!
thanks for ur help!
do you NEED to parse line by line?
if so, heres how to split the data up into lines
if so, heres how to split the data up into lines
Code: Select all
$data = $_POST['data'];
$lines = explode("\r\n", $data);
foreach ($lines as $line) {
// parse 1 line at a time
}