|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-12-29 08:11 UTC] mail at siegfried-bauer dot de
Description:
------------
can't write a backslash into a variable.
Reproduce code:
---------------
#!/home/bauer/prog/php-5.1.6/sapi/cli/php
<?
$fp=fopen("out", "w");
printf("Hello World!\n with \\ one \\\n");
$s=sprintf("Hello World!\n with \\ one \\\n");
fwrite($fp, $s);
fclose($fp);
$fp=fopen("out2", "w");
fprintf($fp, "Hello World!\n with \\ one \\\n");
fclose($fp);
?>
Expected result:
----------------
out doesn't contain any backslas.
out2 yet.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
try perl an d you receive what you will expect! #!/usr/bin/perl printf("This is a \\\n"); my $a=sprintf("\\"); printf("var \$a contains %s\n",$a);