Solved

string function question

Posted on 2006-11-03
2
185 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

760 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

19 Experts available now in Live!

Get 1:1 Help Now