Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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 ¼¼ÊõÄÚĻѧϰ2

1.php Êý¾ÝÀàÐÍ£º¸¡µãÐÍ,×Ö·û´®,ÕûÐÎ,Âß¼­ÐÍ
2.$a="test"; print($a); ÔÚphp.ini ÖÐÉèÖÃerror_reporting=E_ALL ¾¯¸æ״̬ʱ£¬»áÓÐÌáʾ¡£´ËÓÃÓÚ²âÊÔ䶨ÒåµÄ±äÁ¿¡£¿ÉÒÔʹÓÃisset()¼ì²â±äÁ¿ÊÇ·ñ´æÔÚ,unsetÇå³ý±äÁ¿()£¬³£Á¿¶¨Òådefine("a","test");¶¨ÒåµÄ³£Á¿¾ßÓÐÈ«¾Ö×÷Óá£define ÎÞ·¨¶¨Òå¶ÔÏóµÄÊý¾Ý½á¹¹£¬²»¹ý¿ÉÒÔÏÈ´æ´¢±äÁ¿ ......

PHPÖеÄÅú´¦Àí£¨Ò»£©

ת×Ô£º http://www.phpsoho.com/article/php/200809/09-239.html
Èç¹û Web Ó¦ÓóÌÐòÖеÄÒ»¸öÌØÐÔÐèÒª³¬¹ý 1 Ãë»ò 2 Ãë²ÅÄÜÍê³É£¬ÄÇôӦ¸ÃÔõô°ì£¿ÐèҪijÖÖÀëÏß´¦Àí½â¾ö·½°¸¡£Ñ§Ï°¼¸ÖÖ¶Ô PHP Ó¦ÓóÌÐòÖг¤Ê±¼äÔËÐеÄ×÷Òµ½øÐÐÀëÏß·þÎñµÄ·½·¨¡£
´óÐ͵ÄÁ¬ËøµêÓÐÒ»¸ö´óÎÊÌ⡣ÿÌ죬ÔÚÿ¼ÒÉ̵ê»á·¢ÉúÊýǧ´Î½»Òס ......

WindowsÏÂphpºÍmemcahe¿ª·¢

memcached±¾µØwindowsϵͳ²âÊÔ
ÓõÄÊÇwindowsϵͳ¡£
1.ÏÂÔØMemcache for win32
ÏÂÔصØÖ·: http://jehiah.cz/projects/memcached-win32/
Ñ¡Ôñmemcached 1.2.1 for Win32 binaries (Dec 23, 2006) ÊÇexeµÄ³ÌÐò
memcached.exe -d install
memcached -d start
2.ÏÂÔØphp_memcache.dll
ÏÂÔصØÖ·: http://www.wesoho.com/ ......

ÎÒ»ØÀ´ÁË£¬ÖØÐÂͶÈëPHPµÄ»³±§

¹ýÄêÁË£¬Ò²ÕÇÁËÒ»ËêÁË£¬¸Ð¾õûÓг¤½ø°¡£¡
°¦£¡
ÄêÇ°²Î¼ÓÁËÖйúµçÐŵÄÃæÊÔ¡£
¸Ð¾õºÜÒ»°ã£¬Á¬SQLÈ«³ÆÊÇʲô¶¼²»¶®£¬»¹ºÃÒâ˼×Ô³ÆÊìÁ·ÔËÓÃMYSQL£¬°¦£¡
¹ýÍêÄ꣬Ҫ¿ªÊ¼ÎªÊµÏ°¶ø±¼²¨ÁË¡£
ÍøÁú¿´À´ÊÇûϣÍûÁË¡£
Ö»ÄܽøһЩ±È½ÏÒ»°ãµÄ¹«Ë¾Ñ§Ï°Ñ§Ï°ÁË¡£
´Ó½ñÌ쿪ʼ£¬ÈÏÕæ¿´PHP100µÄ×îм¸¸öÊÓƵ¡£
¿ªÊ¼Í¨¶ÁDZµÄ³ÌÐò£¬×¢½âÉÏ ......

»ù´¡PHPÓ﷨ѧϰ£º³£Á¿£¬±äÁ¿

±¾ÎÄת×Ô http://hi.baidu.com/kxw102/blog/item/f1303188d9c148bb0e2444f2.html£¬¸Ðл×÷ÕߵķÖÏí
ÔÚ
PHP
ÖУ¬»ù±¾Êý¾Ý¿ÉÒÔ·ÖΪ³£Á¿ºÍ±äÁ¿Á½ÖÖ¡£³£Á¿ÃûºÍ±äÁ¿Ãûͨ³£³ÆΪ±êʶ·û¡£(
ÐèҪעÒâµÄÊDZêʶ·û±ØÐëÒÔ×Öĸ»òÕßÏ»®Ïß¿ªÍ·£¬²¢ÇÒÖ»ÄÜ°üÀ¨×Öĸ¡¢Êý×ÖºÍÏ»®Ïß
)
ÀýÈ磺
my_function¡¢Size¡¢
_BlackµÈµÈ
1.ÏÂÃæËµÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ