• Back





CODE FOLLOWS

<?php

    
include('../includes/header4.php');


    
$url = "https://geophysics.com";

    
$a = file_get_contents($url);

    
$a = strip_tags($a);

    
//    // echo($a);
    //
    //    // Provides: You should eat pizza, beer, and ice cream every day
    //    $phrase = "You should eat fruits, vegetables, and fiber every day.";
    //    $healthy = array("fruits", "vegetables", "fiber");
    //    $yummy = array("pizza", "beer", "ice cream");
    //
    //    $newphrase = str_replace($healthy, $yummy, $phrase);
    //
    //    echo($newphrase);

    
echo('<br>');

    
// Provides: You should eat pizza, beer, and ice cream every day
    
$phrase1 = $a;
    
$healthy1 = array(" the ", " a ", " and ", ", and", " of ");
    
$yummy1 = array("<br> ", "<br> ", " <br>", " <br>", "<br> ", "<br> ");

    
$newphrase2 = str_replace($healthy1, $yummy1, $phrase1);

    echo(
$newphrase2);

    echo(
'<br>');


    echo(
'<hr>');

    
$a = explode(' ', $a);

    foreach (
$a as $key => $value)
        {
        if (
strlen($value) <= 3)
            {
            
$a[$key] = null;
            }
        }

    
$a = implode(' ', $a);

    echo(
$a);

    echo(
'<br>');

    include(
"../includes/footer4.php");
?>

Last modified: October 13 2022

Line Count: 57

  • Back