2008/01/22 16:45
有个类似的问题在这里找到了答案:)
记录一下:
$Pricea = array("212|RMB","152|RMB","170|RMB","321|RMB","140|USD","210|USD");//价格|符号
foreach($Pricea as $v)
{
$tatol = explode("|", $v);
$a[$tatol[1]] += $tatol[0];
}
foreach($a as $key=>$val){
echo $key.":".$val." "; //符号:价格总数
}
原文:http://www.ybfq.com/blog/article.asp?id=320
记录一下:
$Pricea = array("212|RMB","152|RMB","170|RMB","321|RMB","140|USD","210|USD");//价格|符号
foreach($Pricea as $v)
{
$tatol = explode("|", $v);
$a[$tatol[1]] += $tatol[0];
}
foreach($a as $key=>$val){
echo $key.":".$val." "; //符号:价格总数
}
原文:http://www.ybfq.com/blog/article.asp?id=320
2008/01/22 10:14
按照我一年前的安装方法安装后,最近发现GD库并未完全生效。
在phpinfo中的GD模块显示
GD Support enabled
GD Version bundled (2.0.28 compatible)
GIF Read Support enabled
GIF Create Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
没有JPG。研究了一下网上成功安装的例子,觉得还是php的配置问题,经过三次的失败后,终于成功。最终配置为
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-zlib --with-png --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --enable-sockets --with-iconv --enable-mbstring --with-curl=/usr/local/curl --with-mssql=/usr/local/freetds
主要是--with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype 这两个的配置。
安装成功后,GD模块多了如下显示:
JPG Support enabled
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.2.1
这是昨天做的,php5下的GD库,今天把一台没有安装GD库的运行php4.4的服务器安装GD库。
仍然按照这个步骤安装zlib,libpgn,freetype,jpeg,gd2,然后在原php配置参数上加上--with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype,重新编译,安装完成重启Apache后,看了下phpinfo,成功显示。

不过,并不是完全顺利,在安装php时,提示configure: error: Unable to find gd.h anywhere under /usr/local/gd。
奇怪,去下载了最新的gd-2.0.35,重新编译gd,在编译时就出错。只好再装一次gd-2.0.33,装完看了下在/usr/local/gd/include下有gd.h了。再次装php,就正常了,也不知道是什么原因。
在phpinfo中的GD模块显示
GD Support enabled
GD Version bundled (2.0.28 compatible)
GIF Read Support enabled
GIF Create Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
没有JPG。研究了一下网上成功安装的例子,觉得还是php的配置问题,经过三次的失败后,终于成功。最终配置为
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-zlib --with-png --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --enable-sockets --with-iconv --enable-mbstring --with-curl=/usr/local/curl --with-mssql=/usr/local/freetds
主要是--with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype 这两个的配置。
安装成功后,GD模块多了如下显示:
JPG Support enabled
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.2.1
这是昨天做的,php5下的GD库,今天把一台没有安装GD库的运行php4.4的服务器安装GD库。
仍然按照这个步骤安装zlib,libpgn,freetype,jpeg,gd2,然后在原php配置参数上加上--with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype,重新编译,安装完成重启Apache后,看了下phpinfo,成功显示。

不过,并不是完全顺利,在安装php时,提示configure: error: Unable to find gd.h anywhere under /usr/local/gd。
奇怪,去下载了最新的gd-2.0.35,重新编译gd,在编译时就出错。只好再装一次gd-2.0.33,装完看了下在/usr/local/gd/include下有gd.h了。再次装php,就正常了,也不知道是什么原因。





