Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 µ÷ÓÃ C# dll

ŪÁ˰ëÌì, PHP ÖÕÓÚÄܵ÷ÓÃÎÒµÄC# dll ÁË.
¸ÃËÀµÄ,ÎÒ¶ÔC# COM×¢²áÒ»Ïò²»Á˽â, PHP ÎĵµÉÏÖ»¸øPHPÄDz¿·ÖÄÚÈÝ,û¸æËßÎÒÔõôŪdll
ÎÒ»¹ÉµÙâÙâµÄÓàRegsvr32 ×¢²áÄǸöc# dll.
±³¾°:
Windows xp sp3 ; apache 2.2.14 ; php 5.2.12 ;
VS2010 beta ;
ÓïÑÔ:
PHP5 , C#
C#²¿·Ö:
´´½¨Ò»¸ö C# Class Library . (dll) ......

PHP $_SERVER[¡¯PHP_SELF¡¯]

REQUEST_URI ·µ»ØµÄÊǰüÀ¨ºóÃæÊý¾Ý´®µÄµØÖ·£¬Èç index.php?str=1234 PHP_SELF ÊÇ index.php
--------------------------------------------------------------------------------
$_SERVER[’PHP_SELF’]ÔÚ¿ª·¢µÄʱºò³£»áÓõ½£¬Ò»°ãÓÃÀ´ÒýÓõ±Ç°ÍøÒ³µØÖ·£¬²¢ÇÒËüÊÇϵͳ×Ô¶¯Éú³ÉµÄÈ«¾Ö±äÁ¿£¬Ò²»áÓÐʲôÎÊÌâô?È ......

phpµ¥ÒýºÅºÍË«ÒýºÅµÄÇø±ð

±¾ÎÄת×Ôhttp://xfs39.javaeye.com/blog/411508 ¸Ðл×÷Õß·ÖÏí
phpµ¥ÒýºÅºÍË«ÒýºÅµÄÇø±ð



    ½ñÌ죬ÓÐÒ»ÐÂѧPHPµÄÍøÓÑÎÊÁ˲èũһ¸öÎÊÌ⣺“µ¥ÒýºÅºÍË«ÒýºÅµÄÇø±ðºÍÓ÷¨£¿”£¬ÏÖ½«´ð°¸×ܽáÁËÏ£¬Ð´³ÉÕâÆªÐ¡¶ÌÎÄ¡£
" "Ë«ÒýºÅÀïÃæµÄ×ֶλᾭ¹ý±àÒëÆ÷ ......

FastCGI ²»ÍêÈ«¸ß¼¶Ö¸ÄÏ£¨PHP°æ£¬Windowsƽ̨£©

Ò»¡¢FastCGIÊÇʲô£¿
FastCGIÊÇÓïÑÔÎ޹صġ¢¿ÉÉìËõ¼Ü¹¹µÄCGI¿ª·ÅÀ©Õ¹£¬ÆäÖ÷ÒªÐÐΪÊǽ«CGI½âÊÍÆ÷½ø³Ì±£³ÖÔÚÄÚ´æÖв¢Òò´Ë»ñµÃ½Ï¸ßµÄÐÔÄÜ¡£ÖÚËùÖÜÖª£¬CGI½âÊÍ Æ÷µÄ·´¸´¼ÓÔØÊÇCGIÐÔÄܵÍϵÄÖ÷ÒªÔ­Òò£¬Èç¹ûCGI½âÊÍÆ÷±£³ÖÔÚÄÚ´æÖв¢½ÓÊÜFastCGI½ø³Ì¹ÜÀíÆ÷µ÷¶È£¬Ôò¿ÉÒÔÌṩÁ¼ºÃµÄÐÔÄÜ¡¢ÉìËõÐÔ¡¢Fail- OverÌØÐԵȵȡ£
FastCGIµÄ¹Ù ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ