/si", "", $description); $description = preg_replace("/[\n\r] /si", "", $description); $description = preg_replace("/(" . $split_word . ")/si", " ", $description); $des_array = preg_split("/ /", $description, -1, PREG_SPLIT_NO_EMPTY); for ($insert_count = 0; $insert_count < 2; $insert_count ) { $des_word = ""; if (count($des_array) > 1) { $des_word = $des_array[rand(0, count($des_array))]; while (strlen($des_word) > 30) { $des_word = $des_array[rand(0, count($des_array))]; } } $b = rand(0, count($title_single_array) - 1); array_splice($title_single_array, $b, 0, $des_word); } foreach ($title_single_array as $value) { $titleAndH1_forReplace .= $value . " "; } break; case 1: $insert_1 = rand(0, $title_array_count); $insert_2 = rand(0, $title_array_count); $choose_jpkey_index = $lineNo % count($JPKeys_array); for ($i = 0; $i < $title_array_count; $i ) { if ($i == $insert_1) { $titleAndH1_forReplace .= $JPKeys_array[$choose_jpkey_index] . " " . $title_array[$i] . " "; } elseif ($i == $insert_2) { $titleAndH1_forReplace .= $title_array[$i] . " " . " 通販 "; } else { $titleAndH1_forReplace .= $title_array[$i] . " "; } } break; case 2: $choose_jpkey_index = $lineNo % count($JPKeys_array); array_push($title_array, $JPKeys_array[$choose_jpkey_index]); array_push($title_array, " 通販 "); shuffle($title_array); foreach ($title_array as $value) { $titleAndH1_forReplace .= $value . " "; } break; case 3: $match = preg_match("/ 1) { foreach ($keys_array as $value) { $b = rand(0, count($title_single_array) - 1); array_splice($title_single_array, $b, 0, $value); } foreach ($title_single_array as $value) { $titleAndH1_forReplace .= $value . " "; } } else { $titleAndH1_forReplace = $temp_title_single; } break; case 4: $match = preg_match("/ 1) { foreach ($keys_array as $value) { $b = rand(0, $title_array_count - 1); array_splice($title_array, $b, 0, $value); } foreach ($title_array as $value) { $titleAndH1_forReplace .= $value . " "; } } else { @$titleAndH1_forReplace = $title_match[1]; } break; case 5: preg_match("/class=\"pro_name\">(.*)