$file_handle = fopen($filename, "w");
if($file_handle == false)
exit("Error:failed to open file $filename");
+
if(substr(PHP_OS, 0, 3) == "WIN") {
$data = str_replace("\r",'', $data);
}
<html> html </html> <?php echo "php"; ?>
EOT;
-
+if(substr(PHP_OS, 0, 3) == "WIN") {
+ $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
/* try reading the file opened in different modes of reading */
$file_modes = array("r","rb", "rt","r+", "r+b", "r+t");
echo "Done\n";
?>
---EXPECTF--
+--EXPECT--
*** Testing fgetss() : Basic operations ***
-- Testing fgetss() with file opened using r mode --
is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg>
<html> html </html> <?php echo "php"; ?>
EOT;
-
+if(substr(PHP_OS, 0, 3) == "WIN") {
+ $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
$filename = dirname(__FILE__)."/fgetss_basic2.tmp";
/* try reading the file opened in different modes of reading */
this is the line with \n character.
EOT;
+if(substr(PHP_OS, 0, 3) == "WIN") {
+ $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
+
$filename = dirname(__FILE__)."/fgetss_variation1.tmp";
/* try reading the file opened in different modes of reading */
echo "Done\n";
?>
---EXPECTF--
+--EXPECT--
*** Testing fgetss() : usage variations ***
-- Testing fgetss() with file opened using w mode --
this is the line with \n character.
EOT;
+if(substr(PHP_OS, 0, 3) == "WIN") {
+ $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
+
$filename = dirname(__FILE__)."/fgetss_variation3.tmp";
/* try reading the file opened in different modes of reading */
echo "Done\n";
?>
---EXPECTF--
+--EXPECT--
*** Testing fgetss() : usage variations ***
-- Testing fgetss() with file opened using w+ mode --
--TEST--
Test fgetss() function : usage variations - read modes, file pointer at EOF
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN")
+ die("skip not for Windows");
+?>
--FILE--
<?php
/*
this text contains some html tags <body> body </body> <br> br </br>
this is the line with \n character.
EOT;
+if(substr(PHP_OS, 0, 3) == "WIN") {
+ $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
$filename = dirname(__FILE__)."/fgetss_variation5.tmp";
echo "Done\n";
?>
---EXPECTF--
+--EXPECT--
*** Testing fgetss() : usage variations ***
-- Testing fgetss() with file opened using w+ mode --
filled => total files filled, always returned as 1
perms_changed => total files permission changed
*/
-function create_links( $file_path,
- $filename,
- $link_count = 1,
- $link_type = "soft",
- $link_size = 1024,
- $link_name_prefix = "link",
- $link_name_suffix = 1,
- $link_file_content = "text",
- $link_perms = 0755,
- $link_file_extension = ".tmp"
+function create_links($file_path,
+ $filename,
+ $link_count = 1,
+ $link_type = "soft",
+ $link_size = 1024,
+ $link_name_prefix = "link",
+ $link_name_suffix = 1,
+ $link_file_content = "text",
+ $link_perms = 0755,
+ $link_file_extension = ".tmp"
)
{
$return_value = array('created' => 0, 'filled' => 0, 'perms_changed' => 0);