number of 5 digits?
Moderator: General Moderators
number of 5 digits?
how can I check if variable is number of 5 digits?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
echo (preg_match('#^\d{5}$#',$value)?'yes':'no');- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
[offtopic]
Code: Select all
$now_with_beer = preg_replace('#\bwater\b#i',"[i]your favorite fermented beverage 'ere[/i]",$without_beer);