Jump to content

trim


jkkenzie

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.