开发者

Fix first four numbers in textbox PHP

开发者 https://www.devze.com 2023-04-07 15:19 出处:网络
I want to restrict first four number in textbox in PHP, Here\'s my sample code开发者_JAVA百科: <label>Number </label>

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

精彩评论

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