-1
我们有动态的帖子,我们应该在URL转换阵列串(分3个字)
$this->post_message = "THIS IS SAMPLE STRING FOR TEST";
if (strlen($this->post_message) > 5) {
$key='<> ";,/\][{}|`~!#$%^&*_+=-';
$bodypost1 =trim($this->post_message,$key);
$bodypost2 = explode (' ',$bodypost1,3);
$bodypost = array_shift(',',$bodypost2);
}else{
$bodypost2 = explode (' ',$this->post_message,3);
$bodypost = array_shift(',',$bodypost2);
}
分割字符串的3个字的使用,这是URL参数
$this->permalink = $C->SITE_URL.'view/'.($type=='private'?'priv':'post').':'.$this->post_id.'/'.$bodypost.'.html';
和我的网址回:
sitename.com/123/THIS.html
而应该是
sitename.com/123/THIS IS SAMPLE.ht毫升
你想要得到的'$这个 - > post_message'的第三个字?只是澄清.. – Vainglory07
是的,我想要得到$ this-> post_message的第一个三字! – user3261715