Recode a string in a PHP file

Concluído Postado Feb 4, 2016 Pago na entrega
Concluído Pago na entrega

I like help to remove one comma in the end of a string.

In attached file on row 91 I have which starts on $item_clerkio... which is enbedded in a while loop.

91: $item_clerkio .= '{\'id\': ' . tep_db_output($items['products_id']) . ', \'quantity\': ' . $items['products_quantity'] . ', \'price\': ' . number_format($items['final_price'], 2, '.', '') . '},';

The result if you have one items in the basket on checkout is:

{'id': 140, 'quantity': 1, 'price': 714.95},

If you have two items:

{'id': 140, 'quantity': 1, 'price': 714.95}, {'id': 120, 'quantity': 2, 'price': 29.90},

I which to get some help to know what to write to be able to remove the last comma in the string $item_clerkio I guess it's easy to add a regex and remove the last comma in the $item_clerkio before writing it out.

HTML PHP Expressões Regulares

ID do Projeto: #9557580

Sobre o projeto

4 propostas Projeto remoto Ativo em Feb 4, 2016

Concedido a:

drailean

Hello! That'd be a single line of code to add there, I can send it to you right away once project awarded. Regards, Dragos

€19 EUR em 0 dias
(237 Comentários)
6.8

4 freelancers estão ofertando em média €26 nesse trabalho

black92

hello,assalamualaikum.I experienced in the field of web design and web developer. I can finish your project to always communicate to you. every day I will communicate the progress that I do to complete your project. Mais

€30 EUR in 2 dias
(4 Comentários)
2.1
rahul01101989

Hello I have 5 years experience i am Web Developer . As a developed websites for many companies and individuals from small to large business. professional skills below:- Programming Languages/Technologies Mais

€25 EUR em 1 dia
(0 Comentários)
0.0