All pastes #204034 Raw Edit

Untitled

public text v1 · immutable
#204034 ·published 2006-10-15 16:30 UTC
rendered paste body
	$word = "book";

    // initialise the session, this time with no URL
    $ch = curl_init();
    
    // Set the URL, which includes $word, and is of the dict protocol
    curl_setopt($ch, CURLOPT_URL, "dict://dict.org/d:($word)");
    
    // Return the output from the cURL session rather than displaying in the browser.
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    
    //Execute the session, returning the results to $definition, and close.
    $definition = curl_exec($ch);
    curl_close($ch);

    //display the results - I'll leave the formatting to you
    print "Definition of $definition: $definition";

   var_dump($definition);