How To Remove Numbers From A String Php
how to remove numbers from a string php
how, to, remove, numbers, from, a, string, php
How To Remove Numbers From A String Php
Post Description: how to remove numbers from a string php
POST# 676
Posted On: Fri Feb 29, 2008 12:01 pm
web hosting
Topic: How To Remove Numbers From A String Php
lets say you have a string in a form and you want to delete all the numbers from the value of that string. well, today, i will show you..



you can use this function



CODE:
<?php

# FUNCTION BY WWW.WEBUNE.COM
function remove_numbers($string) {
$vowels = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ");
$string = str_replace($vowels, '', $string);
return $string;
}
$string='This string will have all numbers removed - 213 555 3930';
echo remove_numbers($string);
?>




this will remove all the numbers from the variable string



OUTPUT:
This string will have all numbers removed -
Share:
BBCODE:
HTML Code:


No Repies
(0) Comments for How To Remove Numbers From A String Php

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload