<?php$get = addslashes($_GET['term']); // The term to define$num = addslashes($_GET['num']); // The definition number.$newget = str_replace(" ", "%20", $get); // Replace spaces in the URL with %20.if ($_GET['term'] == '' || $_GET['term'] == ' ' || $_GET['term'] == null) { // If term is not defined, do this: echo "you need to define a word. Use as: define.php?term=word"; // Echo this message.} else { // If term is defined, do this: $html = file_get_contents("http://www.urbandictionary.com/define.php?term=" . $newget . ""); // Open the website URL, with the specified term. $html = str_replace("\n", "", $html); // Replace breaks with nothing. preg_match("/<div class=\"def_p\">(.*?)<\/div>/", $html, $quote); // Search for where the definition starts to be defined in the website. $ex = explode("</p>", $quote[0]); // Get rid of the </p> $d = trim(strip_tags($ex[0])); // Trim up the definition. $e = trim(strip_tags($ex[1])); // Trim up the example. echo "Definition: "; // Echo echo $d; // Echo the Definition echo " Example: "; // Echo echo $e; // Echo the Example}?>