Solved

string function question

Posted on 2006-11-03
2
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

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…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

615 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