php ×Ö·û´®¡¢Îļþת»¯³É¶þ½øÖÆÁ÷Îļþ
$file1 = 'F:/46.gif';
$file2 = 'F:/test.txt';
$file3 = 'F:/47.gif';
$size = filesize($file1);
echo 'Îļþ´óСΪ£º'.$size;
echo "\n<br>ת»¯Îª¶þ½øÖÆ ...";
$content = file_get_contents($file1);
$content = bstr2bin($content);
$fp = fopen($file2, 'w');
fwrite($fp, $content);
fclose($fp);
$size2 = filesize($file2);
echo 'ת»¯³É¶þ½øÖƺóÎļþ´óСΪ£º'.$size2;
$content = bin2bstr($content);
$fp = fopen($file3, 'w');
fwrite($fp, $content);
fclose($fp);
function bin2bstr($input)
// Convert a binary expression (e.g., "100111") into a binary-string
{
if (!is_string($input)) return null; // Sanity check
// Pack into a string
$input = str_split($input, 4);
$str = '';
foreach ($input as $v)
{
$str .= base_convert($v, 2, 16);
}
$str = pack('H*', $str);
return $str;
}
function bstr2bin($input)
// Binary representation of a binary-string
{
if (!is_string($input)) return null; // Sanity check
// Unpack as a hexadecimal string
$value = unpack('H*', $input);
// Output binary representation
$value = str_split($value[1], 1);
$bin = '';
foreach ($value as $v)
{
$b = str_pad(base_convert($v, 16, 2), 4, '0', STR_PAD_LEFT);
$bin .= $b;
}
return $bin;
}
Ïà¹ØÎĵµ£º
<?php
/* @author: zhuyubing@gmail.com */
class Template{
var $code;
function Template($template){
$this->code = implode('', @file($tem ......
how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled
with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE
9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all
Linux-like operating ......
¹ýÄêÁË£¬Ò²ÕÇÁËÒ»ËêÁË£¬¸Ð¾õûÓг¤½ø°¡£¡
°¦£¡
Äêǰ²Î¼ÓÁËÖйúµçÐŵÄÃæÊÔ¡£
¸Ð¾õºÜÒ»°ã£¬Á¬SQLÈ«³ÆÊÇʲô¶¼²»¶®£¬»¹ºÃÒâ˼×Ô³ÆÊìÁ·ÔËÓÃMYSQL£¬°¦£¡
¹ýÍêÄ꣬Ҫ¿ªÊ¼ÎªÊµÏ°¶ø±¼²¨ÁË¡£
ÍøÁú¿´À´ÊÇûϣÍûÁË¡£
Ö»ÄܽøÒ»Ð©±È½ÏÒ»°ãµÄ¹«Ë¾Ñ§Ï°Ñ§Ï°ÁË¡£
´Ó½ñÌ쿪ʼ£¬ÈÏÕæ¿´PHP100µÄ×îм¸¸öÊÓÆµ¡£
¿ªÊ¼Í¨¶ÁDZµÄ³ÌÐò£¬×¢½âÉÏ ......
±¾ÎÄת×Ô http://hi.baidu.com/kxw102/blog/item/f1303188d9c148bb0e2444f2.html£¬¸Ðл×÷ÕߵķÖÏí
ÔÚ
PHP
ÖУ¬»ù±¾Êý¾Ý¿ÉÒÔ·ÖΪ³£Á¿ºÍ±äÁ¿Á½ÖÖ¡£³£Á¿ÃûºÍ±äÁ¿Ãûͨ³£³ÆÎª±êʶ·û¡£(
ÐèҪעÒâµÄÊDZêʶ·û±ØÐëÒÔ×Öĸ»òÕßÏ»®Ïß¿ªÍ·£¬²¢ÇÒÖ»ÄܰüÀ¨×Öĸ¡¢Êý×ÖºÍÏ»®Ïß
)
ÀýÈ磺
my_function¡¢Size¡¢
_BlackµÈµÈ
1.ÏÂÃæËµÏ ......
ÎÊÌâÒ»£ºcactiÈç·¨Õý³£µÇ¼£¬Ã»Óб¨PHP³ÌÐò´íÎó
½â¾ö¹ý³Ì½â¾ö¹ý³Ì£º¿ªÆôPHP±¨´íÏÔʾ£¨ÔÚµ÷ÊÔʱ£¬Ò»Ö±¿¨ÔÚÕâ¶ù£¬ÓÉÓÚÊÇ·þÎñÆ÷ÉÏ£¬Ã»ÓпªÆô±¨´í³ÌÐò£©display_errors = On
·¢ÏÖ±¨Warning: session_start() [ ......