Subversion Repositories php-qbpwcf

Rev

Rev 3 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 226
Line 1... Line 1...
1
#!/usr/bin/php
1
#!/usr/bin/php
2
<?php
2
<?php
3
 
3
 
4
/*
4
/*
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2024 Min-Jhin,Chen
6
    Copyright (C) 2014~2025 MIN ZHI, CHEN
7
 
7
 
8
    This file is part of QBPWCF.
8
    This file is part of QBPWCF.
9
 
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
11
    it under the terms of the GNU General Public License as published by
Line 17... Line 17...
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
18
    GNU General Public License for more details.
19
 
19
 
20
    You should have received a copy of the GNU General Public License
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
    
22
 
23
*/
23
*/
24
 
24
 
25
/*
25
/*
26
檢視檔案的16進位內容
26
檢視檔案的16進位內容
27
*/
27
*/
Line 59... Line 59...
59
#如果一次讀取的大小為0bytes
59
#如果一次讀取的大小為0bytes
60
if($bytes===0)
60
if($bytes===0)
61
{
61
{
62
	#空格變成空字串
62
	#空格變成空字串
63
	$space="";
63
	$space="";
64
	
64
 
65
	#換行變成空字串
65
	#換行變成空字串
66
	$PHP_EOL="";
66
	$PHP_EOL="";
67
	
67
 
68
	#一次讀取1024bytes
68
	#一次讀取1024bytes
69
	$bytes="1024";
69
	$bytes="1024";
70
 
70
 
71
}#if end
71
}#if end
72
 
72
 
Line 79... Line 79...
79
 
79
 
80
	#該行的內容
80
	#該行的內容
81
	$line="";
81
	$line="";
82
 
82
 
83
	$line=$line.$PHP_EOL;
83
	$line=$line.$PHP_EOL;
84
	
84
 
85
	#如果要整齊印出
85
	#如果要整齊印出
86
	if($space!=="")
86
	if($space!=="")
87
	{
87
	{
88
		$line=$line.strtoupper(sprintf("%08s",base_convert($bytes*$i,10,16))).$space;
88
		$line=$line.strtoupper(sprintf("%08s",base_convert($bytes*$i,10,16))).$space;
89
		$line=$line.strtoupper(sprintf("%08s",$bytes*$i)).$space;
89
		$line=$line.strtoupper(sprintf("%08s",$bytes*$i)).$space;
90
	}
90
	}
91
	
91
 
92
	for($j=0;$j<strlen($next);$j++)
92
	for($j=0;$j<strlen($next);$j++)
93
	{
93
	{
94
		$line=$line.strtoupper(sprintf("%02s",base_convert(ord($next[$j]),10,16))).$space;
94
		$line=$line.strtoupper(sprintf("%02s",base_convert(ord($next[$j]),10,16))).$space;
95
	}	
95
	}
96
	
96
 
97
	#移除不必要的符號再印出
97
	#移除不必要的符號再印出
98
	echo $line;
98
	echo $line;
99
	
99
 
100
	#計數+1
100
	#計數+1
101
	$i++;
101
	$i++;
102
}
102
}
103
?>
103
?>