![]()
$var ="Hello lopphp"; $var = substr($var,0,-1); echo $var;
Kết quả sẻ là : Hello lopph
Hàm substr lấy 3 tham số , 1 là chuỗi cần cắt 2 là vị trí 0 là từ đầu chuỗi và ta truyền -1 làm tham số cuối cùng hàm sẽ hiểu là toàn bộ chiều dài chuỗi trừ đi 1..
Nguồn: http://www.lopphp.com/2011/02/b%E1%BB%8F-ki-t%E1%BB%B1-cu%E1%BB%91i-cung-b%E1%BA%B1ng-ham-substr-php/
thiet ke webs pro,, thiết kế webs pro, thiet ke website pro, thiết kế website pro, Thietkewebsitepro,thiết kế web,thiet ke web,giao dien web,giao diện web



0945.022.860


