小编use*_*321的帖子

以php格式验证手机号码

我想验证10位数的手机号码,并在进入数据库时​​添加前缀0.

<?php

include ('database_connection.php');

$citystate = $_POST['citystate'];
$serviceprovider = $_POST['serviceprovider'];
$accept = $_POST['accept'];
if (isset($_POST['formsubmitted'])) {
    $error = array(); //Declare An Array to store any error message 

    if (isset($_POST['checkbox'])) {
        $mumbai = (in_array("mumbai", $_POST['checkbox']) ? 1 : 0);
        $pune = (in_array("pune", $_POST['checkbox']) ? 1 : 0);
        $banglore = (in_array("banglore", $_POST['checkbox']) ? 1 : 0);
        $mysore = (in_array("mysore", $_POST['checkbox']) ? 1 : 0);
    }

    if ($mumbai + $pune + $banglore + $mysore == 0) {
        $error[] = 'Please check atleast one …
Run Code Online (Sandbox Code Playgroud)

php mysql forms mobile

5
推荐指数
1
解决办法
4万
查看次数

标签 统计

forms ×1

mobile ×1

mysql ×1

php ×1