我有一個文本框的值 我必須找出文本值中的%符號 任何人都可以告訴我該怎麼做?Preg匹配查找文本框中的%值
我有一個包含一定的價值的文本框,我必須找出文本中是否含有%符號或不
$camp_ttllimpression=$_POST['camp_ttllimpression'];
$camp_ttllclicks=$_POST['camp_ttllclicks'];
$camp_ttlleads=$_POST['camp_ttlleads'];
$camp_ttllsales=$_POST['camp_ttllsales'];
$hid=$_POST['hid'];
$camp_cpa_amnt=$_POST['camp_cpa_amnt'];
$camp_cpm_amnt=$_POST['camp_cpm_amnt'];
$camp_cpc_amnt=$_POST['camp_cpc_amnt'];
$camp_cpl_amnt=$_POST['camp_cpl_amnt'];
$camp_cpm_budgt=($camp_ttllimpression * $camp_cpm_amnt)/1000;
$camp_cpc_budgt=$camp_ttllclicks * $camp_cpc_amnt;
$camp_cpl_budgt=$camp_ttlleads * $camp_cpl_amnt;
$camp_cpa_budgt=$camp_ttllsales * $camp_cpa_amnt;
if($hid=="%") { echo Open;} else { echo $camp_cpa_budgt;}
請忽略 – 2012-01-30 13:48:56
你的意思是PHP變量「%是文某處該文本框「或」%是該文本框的唯一內容「? – 2012-01-30 13:53:08