开发者

Fix first four numbers in textbox PHP

I want to restrict first four number in textbox in PHP, Here's my sample code开发者_JAVA百科:

<label>Number </label>
<input name="phone" type="text" class="required" id="phone" value="<?=$phone_number?>" maxlength="11" />

Anyone can help?


Like this...

$phone_number = '0116' . $_POST['phonenumber'];

This can be the same

<label>Number </label>
<input name="phone" type="text" class="required" id="phone" value="?=$phone_number?>" maxlength="11" />

Whereever you use the phone number add the digits you want via php.


<label>Number </label>
<input name="phone" type="text" class="required" id="phone" value="1234<?=$phone_number?>" maxlength="11" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜