mytrin function

Home Home
引用 | 編輯 surro
2004-12-31 23:20
樓主
推文 x0
我寫的一個小function
可以做出類似vb裡面 trim的功能
比php的trim函數好用一點點....

function mytrim($tmps){
  $tmp2=strlen($tmps);
  for ($i=0;$i<=$tmp2;$i++)
  {
    $tmp3=substr($tmps,$i,1);
   
    if ($tmp3<>" "){
        $str=$str.$tmp3;
    }
  }
 
  return $str;
}

獻花 x0