Ask a Question related to PHP Development, Design and Development.
-
Chris Styles #1
Writing strings to files
Dear All,
I'm fairly new to PHP (i'm converting from Perl) and so I'm still getting up
the learning curve.
I'm seeing some odd behaviour when writing certain strings to files.
The line that is failing is :
fwrite ($fp,"#include <avr/io.h>\n");
It only writes the "#include" part. It seems that it is the "<" that is
causing the problem as the following line works a treat.
fwrite ($fp,"#include avr/io.h>\n");
I have even tried writing it using a variable, i.e.
$myvar = "#include <avr/io.h>";
fwrite ($fp,"$myvar\n");
but that doesnt work either.
So, how do i write the character "<" to a file?
Any help much appreciated..
Chris
Chris Styles Guest
-
php writing files and permissions
Hi, I have a php function that uploads images to a directory on my server, I've just changed hosting company and now I get the following error... -
writing excel files
I need to be able to create Microsoft Excel files from a perl script. I want to know which module for doing this that people recommend. I don't need... -
Reading and writing files in PHP
"Marc" <meelzooi2000@yahoo.com> wrote in message news:acad69df.0309010758.2de3fef5@posting.google.com... processing the file (not having written... -
Writing to files
Is there a way to write to a beginning of a file without it overwriting data that's already there or do I have to write to the end of the file in... -
[PHP] Writing to files
Hello, This is a reply to an e-mail that you wrote on Fri, 11 Jul 2003 at 20:37, lines prefixed by '>' were originally written by you. How... -
Janwillem Borleffs #2
Re: Writing strings to files
Chris Styles wrote:
Are you watching the result with a web browser? In that case <avr/io.h> gets> I'm seeing some odd behaviour when writing certain strings to files.
>
> The line that is failing is :
>
> fwrite ($fp,"#include <avr/io.h>\n");
>
> It only writes the "#include" part. It seems that it is the "<" that
> is causing the problem as the following line works a treat.
>
treated as a tag and therefore not displayed.
Look at the source directly, or apply htmlentitities before writing:
fwrite ($fp, htmlentities("#include <avr/io.h>\n"));
JW
Janwillem Borleffs Guest
-
Andy Hassall #3
Re: Writing strings to files
On Sat, 25 Sep 2004 13:47:21 +0200, "Janwillem Borleffs" <jw@jwscripts.com>
wrote:
... or sent a Content-type: text/plain header.>Are you watching the result with a web browser? In that case <avr/io.h> gets
>treated as a tag and therefore not displayed.
>
>Look at the source directly, or apply htmlentitities before writing:
>
>fwrite ($fp, htmlentities("#include <avr/io.h>\n"));
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Andy Hassall Guest



Reply With Quote

