SyntaxFix
Write A Post
Hire A Developer
Questions
Try the below code:
$my_string = "'name', 'name2', 'name3',"; echo substr(trim($my_string), 0, -1);
Use this code to remove the last character of the string.