Example #1
0
 foreach ($table_array as $table_val) {
     $insert_database_array[$table_val] = array();
     $table_title = $table_title_array[$table_val];
     foreach ($table_title as $title) {
         $post_name = $table_val . '_' . $title;
         $post_data = empty($post[$post_name]) ? '' : $post[$post_name];
         $post_data = substr_count($post_data, "标签:") ? '' : $post_data;
         if (in_array($title, $string_array)) {
             $insert_database_array[$table_val][$title] = trim(mysql_real_escape_string(strip_tags(remove_xss(str_replace('\\', '', strip_tags(htmlspecialchars_decode($post_data)))))));
         } elseif (in_array($title, $array_array)) {
             $insert_database_array[$table_val][$title] = getfond($title, $post_data);
         } elseif ($title == 'birthyear') {
             $insert_database_array[$table_val][$title] = date('Y') - $post_data;
         } else {
             if (!empty($post_data)) {
                 $insert_database_array[$table_val][$title] = getArr($title, $post_data);
             }
         }
     }
 }
 if (empty($insert_database_array["members_search"])) {
     continue;
 }
 // $insert_database_array["members_search"]['username']='******';
 $insert_database_array["members_search"]['password'] = md5('zays5920');
 $insert_database_array["members_base"]['website'] = $ziyuan;
 //$insert_database_array["members"]['birthmonth']=rand(1,12);
 //$insert_database_array["members"]['birthday']=rand(1,28);
 $insert_database_array["members_search"]['certification'] = rand(6, 20);
 $insert_database_array["members_base"]['source'] = $ziyuan;
 $insert_database_array["members_search"]['usertype'] = 3;
Example #2
0
<?php

function getArr()
{
    return array_map('intval', explode(' ', trim(fgets(STDIN))));
}
$t = (int) fgets(STDIN);
while ($t-- > 0) {
    list($m, $n) = getArr();
    $boys = getArr();
    $girls = getArr();
    sort($boys);
    sort($girls);
    $ok = true;
    foreach (array_map(null, $boys, array_slice($girls, 0, $m)) as $v) {
        if ($v[0] <= $v[1]) {
            echo "NO\n";
            $ok = false;
            break;
        }
    }
    if ($ok) {
        echo "YES\n";
    }
}
Example #3
0
                break;
            default:
                if (is_array($arr)) {
                    $r = '';
                    foreach ($arr as $str) {
                        $r .= $str . ",";
                    }
                    return $r;
                } else {
                    return $arr;
                }
        }
    }
}
if (isset($argv[1]) and file_exists($argv[1])) {
    $domains = getArr($argv[1]);
} else {
    echo "no file \n";
    die;
}
function getArr($filename)
{
    $file_array = file($filename);
    foreach ($file_array as $i => $url) {
        $file_array[$i] = rtrim($file_array[$i]);
    }
    return $file_array;
}
function connectToDB()
{
    echo "connecting to DB";