Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

string function question

Posted on 2006-11-03
2
Medium Priority
?
193 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

715 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