Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Mar 18, 2013
1 parent 9799d16 commit 0046749
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -72,6 +72,17 @@ if ( false === futil_rmtree("/path/to/delete") ) {

$newfilename = futil_filename_append_suffix("Picture.png", "_suffix"); // Returns "Picture_suffix.png"
$newfilename = futil_filename_append_suffix("Picture", "_suffix"); // Returns "Picture_suffix"

$content = futil_get_contents_from_files(array("file1","file2","file3"));

$contents = futil_get_contents_array_from_files(array("config.m4","php_fileutil.c"));
foreach( $contents as $content ) {
echo $content['path'];
echo $content['content'];
}



```


Expand Down
4 changes: 2 additions & 2 deletions php_fileutil.c
Expand Up @@ -667,8 +667,8 @@ PHP_FUNCTION(futil_get_contents_array_from_files)
char *contents = NULL;
int contents_len = 0;
if ( file_get_contents(filename, filename_len, &contents, &contents_len TSRMLS_CC) ) {
add_assoc_stringl(z_newitem,"content",contents, contents_len,0);
add_assoc_stringl(z_newitem,"path",filename, filename_len,0);
add_assoc_stringl(z_newitem,"content",contents, contents_len, 0);
add_assoc_stringl(z_newitem,"path",filename, filename_len, 0);
}
add_next_index_zval(return_value,z_newitem);
}
Expand Down

0 comments on commit 0046749

Please sign in to comment.