Son dize Kaldır eğer onun ','

0 Cevap

ben böyle dize var

$string =  'aaaaaa, bbbbbb, cccccc, ';

ve ben böyle olmasını modifiye istiyorum

$string = 'aaaaaa, bbbbbb, cccccc';

Son ',' ve boşluk kaldırılır.

how to do this in php? what is the function needed the achieve that?


benim tam kodu bu gibi

if(isset($_POST['accomodation']))   $accomodation = 'Accomodation, ';
if(isset($_POST['dance']))          $dance = 'Dance Lessons, ';
if(isset($_POST['vacation']))       $vacation   = 'Vacation planning, ';
if(isset($_POST['group']))      $group = 'Group Vacation, ';
if(isset($_POST['inprivate']))      $inprivate = 'Private Vacation, ';
if(isset($_POST['land']))           $land = 'Land purchase/lease';
if(isset($_POST['all']))            $all    = 'All';

@$interest = $accomodation.$dance.$vacation.$group.$inprivate.$land;
@echo $string;

* Böyle aptal soru için üzgünüm, bu i yerli PHP programlama dokunmadı çok uzun zaman oldu

0 Cevap