Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

last item coma replace and php

$likes = 'Apple, Samsung, Microsoft';
$likes = preg_replace("/,([^,]+)$/", " and $1", $likes)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #item #coma #replace #php
ADD COMMENT
Topic
Name
6+3 =