FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
php-rar/example.php at v4.x · php-win-ext/php-rar · GitHub
php-win-ext
php-rar
Repository navigation
Code
Issues
2
(2)
Pull requests
1
(1)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
php-rar
/
example.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (15 loc) · 696 Bytes
Breadcrumbs
php-rar
/
example.php
Copy path
File metadata and controls
22 lines (15 loc) · 696 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?
$
archive_name
=
'
/full/path/to/file.rar
'
$
entry_name
=
'
path/to/archive/entry.txt
'
;
//notice: no slash at the beginning
$
dir_to_extract_to
=
'
/path/to/extract/dir
'
;
$
new_entry_name
=
'
some.txt
'
;
$
rar
=
rar_open
(
$
archive_name
)
OR
die
(
'
failed to open
'
.
$
archive_name
);
$
entry
=
rar_entry_get
(
$
rar
,
$
entry_name
)
OR
die
(
'
failed to find
'
.
$
entry_name
.
'
in
'
.
$
archive_name
);
// this will create all necessary subdirs under $dir_to_extract_to
$
entry
->
extract
(
$
dir_to_extract_to
);
/* OR */
// this will create only one new file $new_entry_name in $dir_to_extract_to
$
entry
->
extract
(
''
,
$
dir_to_extract_to
.
'
/
'
.
$
new_entry_name
);
// this line is really not necessary
rar_close
(
$
rar
);
?>
Back
|
FazBrowse Home
|
New Git URL