newbe101
asked on
easy php print character
I am using php to write a php file. How would I fwrite a \' together without my php thinking I only want a '
I tried \\' but I don't think it is right... let me know if I am wrong.
I tried \\' but I don't think it is right... let me know if I am wrong.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Lets say you want a file like this
<?php
$character = '\'';
?>
So you can fwrite
<?php
$content = <<<THEEND
<?php
$character = '\'';
?>
THEEND;
fwrite($file,$content);
?>
or if you want to stick with the single quotes:
<?php
$content = '<?php
$character = \'\\\'\';
?>';
fwrite($file,$content);
?>
Is that what you're looking for?
ASKER
cxr got it for me... thanks both of you.
ASKER