Answers for "last item coma replace and php"

PHP
0

last item coma replace and php

$likes = 'Apple, Samsung, Microsoft';
$likes = preg_replace("/,([^,]+)$/", " and $1", $likes)
Posted by: Guest on September-07-2021

Browse Popular Code Answers by Language