// create a string
$string = '+7';
// try to match the beginning of the string
if(preg_match("{-15 to +12}", $string))
{
// if it matches we echo this line
return {strip all the + sign}
echo 'its a valid gmt time';
}
else
{
echo 'not valid gmt time';
}
質問:
preg_match の最初の {} を見てください。どうすればそれができますか? 正規表現が初めてで、どこから始めればよいかわかりません
2 番目の {} で、正規表現を使用して + 記号を取り除くことはできますか?
GMTの範囲は正しいですか?-14 から +12 ( http://www.php.net/manual/en/timezones.others.phpで見たもの)
ありがとう