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:
Post Tags: how, to, remove, numbers, from, a, string, php
This Post Has Been Viewed 607 Times Since Thu Feb 14, 2008 11:56 am Posted By hostman with 0 replies
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 -

Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About How To Remove Numbers From A String Php




(0) Comments