PHP Classes

File: demo/demo.php

Recommend this page to a friend!
  Classes of castromiltone   PHP Word Completion   demo/demo.php   Download  
File: demo/demo.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Word Completion
Suggest words that complete strings
Author: By
Last change:
Date: 6 years ago
Size: 367 bytes
 

Contents

Class file image Download
<?php
   
require '../WordCompletion.php';
   
    if (isset(
$_POST['input_text']) and isset($_POST['source']))
    {
       
$typed = $_POST['input_text'];
       
$filename = $_POST['source'];
       
       
#ini_set('memory_limit', '-1');
       
$wc = new WordCompletion($filename);
       
$wc->doCompletion($typed);

       
header("Content-Type: Application/json");
        echo
json_encode($wc->suggestions);
    }
 
?>