Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $matchcount = preg_match_all('/<div class="name">(.*?)</div>/s', $data,$matches);
- $hostname = "localhost";
- $username = "root";
- $password = "baekhyun8100";
- $databaseName = "student_information";
- $connect = mysqli_connect($hostname, $username, $password, $databaseName);
- $query = "INSERT INTO student_information";
- $result = mysqli_query($connect, $query);
- if ($matchcount > 0) {
- for($i = 0; $i < $matchcount; $i++) {
- echo("n" . "n");
- #echo($matches[1][$i]);
- echo strip_tags($matches[1][$i], '<div>');
- mysqli_query($connect, "INSERT INTO `student_information` (`name`) VALUES
- ('" . strip_tags($matches[1][$i]) . "');");
- }
- } else {
- echo('No matches');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement