Search
 
SCRIPT & CODE EXAMPLE
 

PHP

last item coma replace and php

$likes = 'Apple, Samsung, Microsoft';
$likes = preg_replace("/,([^,]+)$/", " and $1", $likes)
Comment

PREVIOUS NEXT
Code Example
Php :: update woocommerce cart 
Php :: php array access by key 
Php :: windows logged in user name in php 
Php :: php get all array keys in json 
Php :: php How to add custom button in wordpress admin section 
Php :: php array sort by key 
Php :: laravel search multiple (related) tables 
Php :: create laravel 8 resource route 
Php :: job with queue name in laravel 
Php :: htaccess redirect https laravel 
Php :: laravel phpdoc collection of model 
Php :: laravel fontawesome blade directive 
Php :: EntityManager get repository 
Php :: symfony messenger route 
Php :: codeigniter 4 delete redirect with data 
Php :: laravel inline if else if 
Php :: livewire call another component 
Php :: php sort array by longest 
Php :: php function to remove null or 0 value from array 
Php :: how to create static variable in model laravel 
Php :: php convert latitude longitude to map tile 
Php :: laravel scheduler on shared hosting 
Php :: laravel eloquent duplicate record 
Php :: Write a Multiplication program of two numbers in php using operator 
Php :: alert message in blade template with() 
Php :: php flatten array 
Php :: laravel controller constructor auth user null 
Php :: laravel set production 
Php :: laravel debugbar false 
Php :: in arrray php 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =