[SOLVED]String Manipulation
Posted: Wed Mar 02, 2005 8:55 am
i've been going through the string functions Here And yet i couldnt find anything to really help me, (as usual) what im trying to do is take a phone number, like 555-555-5555 and remove the hyphens. or just basicly make it a 10 digit number with no spaces, hyphens, or periods.. when my script pulls the data from the database it needs to fix the phone numbers before it creates the .csv.
This is what i have.
Thanks,
This is what i have.
Code: Select all
<?
header ("Content-type: text/csv");
$query = "SELECT * FROM cb ";
$result = mysql_query($query) or die(mysql_error());
echo "id, name, phone, address\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo trim($lineї'unique']).",".trim($lineї'name']).",".trim($lineї'phone']).",".trim($lineї'address'])."\n";
}
?>