thinkphpÔõôŲÓú¯Êý
thinkphpÊÇÒ»¿îphpµÄ¿ª·¢¿ò¼Ü£¬ÆäΪ³£¼ûµÄwebÓ¦ÓóÌÐòÌṩÁËÒ»¸ö¿ìËÙ¡¢¼òÆÓ¡¢¸ßЧ¼°¸ßÖÊÁ¿µÄ¿ª·¢ÏµÍ³¡£Ò»Ñùƽ³£À´Ëµ£¬ÔÚ¿ª·¢Ò»¸öwebÓ¦ÓóÌÐòµÄÀú³ÌÖУ¬ÎÒÃÇ»á¶à´ÎʹÓÃһЩҪÁì»òº¯Êý¡£¶øÔÚthinkphp¿ò¼ÜÏ£¬ÔõÑùŲÓú¯ÊýÄØ£¿±¾ÎĽ«ÎªÄúÖðÒ»ÏÈÈÝ¡£
Ò»¡¢È«¾Öº¯Êý
ThinkPHP¿ò¼ÜÔÊÐíŲÓÃPHPÈ«¾Öº¯Êý¡£ºÃ±È£¬ÏÂÃæÊÇһЩ³£¼ûµÄPHPÈ«¾Öº¯Êý¡£
$pos = strpos("hello world", "world"); echo $pos;
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÕâÊÇPHPÖзǾ³£¼ûµÄº¯ÊýÖ®Ò»¡ª¡ª strpos() ¡£¶øÔÚThinkPHP¿ò¼ÜÏÂͬÑù¿ÉÒÔÕâÑùŲÓá£
$pos = strpos("hello world", "world"); echo $pos;
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
¿ÉÒÔ¿´µ½£¬µ±ÎÒÃÇÔÚ¿ØÖÆÆ÷»òÄ£°æÎļþÖÐʹÓÃÕâЩȫ¾Öº¯Êýʱ£¬ÓëÕý³£µÄPHP²Ù×÷ûÓÐʲôÇø±ð¡£
Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
¶þ¡¢ÖúÊÖº¯Êý
ÖúÊÖº¯ÊýÔÚThinkPHP¿ò¼ÜÖÐÊǷǾ³£Óõļ¼ÇÉ£¬ËüÃÇÊǼ¯³ÉÔÚϵͳÄÚ²¿µÄһЩ¼òÆÓ¡¢ÊÊÓõĺ¯Êý£¬¹©¿ª·¢ÕßÔÚ³ÌÐòÖÐËæʱŲÓá£ThinkPHPµÄÖúÊÖº¯ÊýÍùÍùÓÃtp_×÷Ϊǰ׺£¬ÕâÒ²±ãÓÚÎÒÃÇÔÚ´úÂëÖоÙÐÐÇø·Ö¡£ºÃ±È£¬ÎÒÃǾ³£Ê¹ÓõÄtp_log()º¯Êý¡£
tp_log('ÄãºÃ°¡');
µÇ¼ºó¸´ÖÆ
ÏëŲÓÃij¸öÖúÊÖº¯ÊýºÜÈÝÒ×£¬Ö»ÐèÒªÔÚÐèÒªµÄµØ·½Ö±½ÓŲÓü´¿É¡£
Èý¡¢Ê¹ÓÃÃüÃû¿Õ¼ä
ThinkPHP¿ò¼Ü´ó×ÚʹÓÃÁËÃüÃû¿Õ¼äµÄ¿´·¨£¬À´×ÊÖúÎÒÃǸüºÃµØÖÎÀíÎļþºÍº¯Êý¡£Òò´Ë£¬ÔÚʹÓÿò¼ÜµÄÀú³ÌÖУ¬Ê¹ÓÃÃüÃû¿Õ¼äÒ²ÊÇÒ»¸ö²»´íµÄÑ¡Ôñ¡£ºÃ±È£¬ÎÒÃÇ¿ÉÒÔÔÚcontrollerĿ¼ÏÂн¨Ò»¸öÀ࣬ÒýÓÃij¸öÃüÃû¿Õ¼ä£¬È»ºóŲÓÃÆäÖеĺ¯Êý¡£
namespace appcontroller; use thinkController; class Index extends Controller { public function index() { $pos = strpos("hello world", "world"); echo $pos; } }
µÇ¼ºó¸´ÖÆ
ÎÒÃÇÔÚн¨µÄÀàÖÐÒýÈëthinkControllerÃüÃû¿Õ¼ä£¬²¢Å²ÓÃstrpos()º¯Êý¡£ÕâÖÖ·½·¨Ò²ÊÇŲÓú¯ÊýµÄ³£ÓÃÒªÁìÖ®Ò»¡£
ÒÔÉϾÍÊÇThinkPHP¿ò¼ÜÏ£¬Å²Óú¯ÊýµÄ¼¸ÖÖÒªÁìÁË£¬Ï£Íû±¾ÎĶÔÄúµÄ¿ª·¢ÊÂÇéÄÜÓÐËù×ÊÖú¡£
ÒÔÉϾÍÊÇthinkphpÔõôŲÓú¯ÊýµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡