Solved

string function question

Posted on 2006-11-03
2
186 Views
Last Modified: 2006-11-18
$row_dati['classi']  

contains a string like

"1ABIENNIO,1ALST,1BBIENNIO,1BLST,1CBIENNIO,1CLST,1DBIENNIO,1DLST,1EBIENNIO,1ELST,1GBIENNIO"

i need to put a space after the comma ...

1ABIENNIO, 1ALST, 1BBIENNIO, 1BLST, 1CBIENNIO, 1CLST, 1DBIENNIO, 1DLST, 1EBIENNIO, 1ELST, 1GBIENNIO


how do i do that?
0
Comment
Question by:floyd0987
  • 2
2 Comments
 
LVL 30

Accepted Solution

by:
callrs earned 500 total points
ID: 17870833
<?php
$str="1ABIENNIO,1ALST,1BBIENNIO,1BLST,1CBIENNIO,1CLST,1DBIENNIO,1DLST,1EBIENNIO,1ELST,1GBIENNIO";
$str=explode(",",$str);
$str=implode(", ",$str);
echo $str;
?>
0
 
LVL 30

Expert Comment

by:callrs
ID: 17920230
Thanks.

Might be better to use separate variables:
$strArray=explode(",",$str);
$str=implode(", ",$strArray);
echo $str;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now