£Ûת£ÝPHPÖÐstr_replaceº¯ÊýµÄÏê½â
ÔÚʵ¼ÊµÄ³ÌÐò¿ª·¢ÖУ¬Ö´ÐÐ×Ö·û´®Ìæ»»²Ù×÷ÊÇÒ»¼þ·Ç³£¾³£µÄÊ£¬¶Ô
str_replace
º¯ÊýµÄʵÓÃÒ²»á·Ç³£Æµ·±¡£
Õâ¶Îʱ¼äÔÚ¿´¡¶
PHP
ºÍ
MySQL Web
¿ª·¢¡·Ò»Êé¿´µ½
str_replace
½²½â£¬Ò»¶ÎСÌáʾдµ½£º¿ÉÒÔΪ
str_replace
µÄÈý¸ö¶¼Ê¹ÓÃÊý×é´«È룬µ«½²½â±È½Ï¼òµ¥£¬ÓÚÊǾö¶¨×Ô¼ºµÄÊÔÑéһϸú¯ÊýÔÚ¸÷¸ö²ÎÊý´«ÈëÊý×éʱµÄÖ´Ðнá¹û¡£
º¯ÊýÔÐÍ£º
mixed str_replace(mixed needle,mixed new_needle,mixed haystack[,int
&count]);
needle
£ºÒª±»Ìæ»»µÄ×Ö·û´®£¬
new_needle
£ºÌæ»»ÓõÄ×Ö·û´®£¬
haystack
£º²Ù×÷×Ö·û´®£¬
count
£ºÌæ»»´ÎÊý¡¾¿ÉÑ¡²ÎÊý¡¿
ÎÒÃÇÖصãÊÔÑéÇ°Èý¸öÔÚʹÓÃÊý×éÊǵÄÖ´Ðз½Ê½£º
ÔÚ¶¼²»Ê¹ÓÃÊý×éʱ£¬¸Ãº¯ÊýÖ±½ÓʹÓÃ
new_needle
Ìæ»»ËùÓеÄ
needle
²¢·µ»ØÌæ»»ºóµÄ×Ö·û´®¡£È磺
str_replace("m","n","my
name is jim!")
·µ»Ø
ny nane is jin!
1
¡¢Ö»¶Ô
needle
ʹÓÃÊý×é¡£
ʾÀý£º
str_replace(array('m','i'),'n',"my
name is jim!");
·µ»Ø£º
ny nane ns jnn!
¿ÉÒÔ¿´³ö£¬º¯Êý˳ÐòÐԵĶÔÊý×éÖÐÿ¸ö×Ö·û´®½øÐÐÌæ»»£¬²¢·µ»ØÌæ»»ºóµÄ×Ö·û´®¡£
2
¡¢Ö»¶Ô
new_needle
ʹÓÃÊý×é¡£
ʾÀý£º
str_replace('m',array('n','z'),"my name is jim!\n")
·µ»Ø£º
Arrayy naArraye is jiArray!
¸ÃÌæ»»±È½ÏÓÐÒâ˼£¬Èç¹ûÖ»¶ÔµÚ¶þ¸ö²ÎÊýʹÓÃÊý×éÔòº¯Êý½«Æä×÷Ϊ×Ö·û´®
Array
½øÐÐʹÓ㬽«ËùÓеÄ
needle
Ì滻ΪÁËÊý×é¡£
3
¡¢Ö»¶Ô
haystack
ʹÓÃÊý×é¡£
ʾÀý£º
str_replace("m","n",array("my name is
jim!","the game is over!"))
¸ÃÓï¾äÖ´Ðнá¹û·µ»ØÒ»¸öÊý×飬¼´·Ö±ðΪ´«ÈëµÄÁ½¸ö×Ö·û´®Ìæ»»ºóµÄ½á¹û¡£
Èç¹ûÊä³öÊý×éÄÚÈݻῴµ½£º
ny nane is jin! the gane is over!
4
¡¢¶Ô
needle
ºÍ
new_needle
¶¼Ê¹ÓÃÊý×é
Ïà¹ØÎĵµ£º
<html>
<head>
<script type="text/javascript">
<!--
function confirmDelete()
{
return confirm("Are you sure you wish to delete this entry?");
}
//-->
</script>
</head>
<body>
<% $var1 = 2;%> ......
Magento×ñÑÒ»°ãµÄ·½·¨Ê¹ÓõÚÈý·½PHP¿â,¼´£º½«php¿â·Åµ½Ä³¸öĿ¼Ï£¬ÔÚphp.ini»ò³ÌÐòÍ·²¿Ö¸¶¨¸ÃĿ¼»òÕ߸¸Ä¿Â¼Ö¸¶¨Îªinclude_path£¬È»ºó³ÌÐòÖÐʹÓÃinclude_onceÏà¶Ô·¾¶°üº¬¾ßÌåÒýÓõÄphpÎļþ
MagentoµÄlibĿ¼ÒѾĬÈÏÖ¸¶¨Îªinclude_pathÀïÁË£¬ËùÒÔÈç¹ûÓÐ3rd°üÈçVarien·Åµ½libĿ¼ÏÂ,ÓÐÒ»¸öphpÎļþÈ«ÃûΪ$magento_h ......
Ò»¡¢ÏµÍ³»·¾³¼°³ÌÐò˵Ã÷
1¡¢²Ù×÷ϵͳΪwindows server 2003
2 ¡¢iis°æ±¾Îª6.0
3¡¢php°æ±¾Îª5.2.9,¹Ù·½ÏÂÔصØÖ·: http://www.php.net/downloads.php
4¡¢mysql°æ±¾Îª5.1.34,¹Ù·½ÏÂÔصØÖ·:http://dev.mysql.com/downloads/mysql
¶þ¡¢°²×°iis
1¡¢²åÈëwindows server 2003ϵͳ°²×°¹âÅÌ
2¡¢¿ªÊ¼-¿ØÖÆÃæ°å-Ìí¼Óɾ³ý³ÌÐ ......
niginx°²×°Á÷³Ì
Èí¼þÏÂÔØ:--->
mkdir -p /home/dancebear/programe
cd /home/dancebear/programe
wget http://sysoev.ru/nginx/nginx-0.6.31.tar.gz
wget http://www.php.net/get/php-5.2.6.tar.gz/from/this/mirror
wget http://php-fpm.anight.org/downloads/head/php-5.2.6-fpm-0.5.8.diff.gz
wget http://dev ......
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/20100409/54.html
ÈçºÎÔÚPHPÖд´½¨Êý×éÄØ£¿
ÔÚPHPÖÐʹÓÃarrayº¯ÊýÀ´´´½¨Ò»¸öÊý×飬ËüÔÊÐíÒ»¶¨ÊýÁ¿ÓöººÅkey=>value²ÎÊý¡£Key¿ÉÒÔÊÇinteger»òÕßstringÀàÐÍ£¬value¿ÉÒÔÊÇÈκÎÖµ¡£
ÀýÈ磺
<?php
$array = array(“php1″=>”phpdo”, ......