jkkenzie Posted December 30, 2008 Share Posted December 30, 2008 this is my code to get data from my database: <?php mysql_select_db($database_app_conn, $app_conn); $getresults = mysql_query("SELECT DISTINCT `Cell Phone`, `First Name`, `Middle Name`, `Last Name` FROM members WHERE `Cell Phone` LIKE '07%'"); while($rows = mysql_fetch_array($getresults)) { if (!empty($rows['Cell Phone'])){ ?> <tr><td>ALLMEMBERS</td><td ><?php echo $rows['First Name']?> <?php echo $rows['Middle Name']?> <?php echo $rows['Last Name']?> </td><td><?php echo $rows['Cell Phone']; ?> </td></tr> <?php } } ?> I would like when the results are displayed:- <tr><td>ALLMEMBERS</td><td ><?php echo $rows['First Name']?> <?php echo $rows['Middle Name']?> <?php echo $rows['Last Name']?> </td><td><?php echo $rows['Cell Phone']; ?> </td></tr> the `Cell phone` numbers to be shown without the first digit AND remove any space AND -(hiphen) in between the characters. Is that possible? thanks Joe Link to comment https://forums.phpfreaks.com/topic/138847-trim/ Share on other sites More sharing options...
Mchl Posted December 30, 2008 Share Posted December 30, 2008 substr str_replace Link to comment https://forums.phpfreaks.com/topic/138847-trim/#findComment-726057 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.