<?php

if (strlen($_REQUEST['search-text']) < 1) {
  print '[]';
  exit;
}

$terms = array(
  'access',
  'action',
  'active',
  'administration',
  'administrator\'s',
  'advanced',
  'ajax',
  'alfresco',
  'application',
  'applications',
  'aspnet',
  'asterisk',
  'authentication',
  'automation',
  'beginner',
  'best',
  'beta',
  'blogs',
  'board',
  'book',
  'borders',
  'bpel',
  'building',
  'business',
  'busy',
  'calc',
  'capturing',
  'cherrypy',
  'clear',
  'closing',
  'com',
  'communities',
  'community',
  'complete',
  'composite',
  'con',
  'concise',
  'configuration',
  'configuring',
  'construindo',
  'construyendo',
  'content',
  'controls',
  'cookbook',
  'costruire',
  'course',
  'cpanel',
  'creating',
  'custom',
  'customizing',
  'database',
  'deep',
  'definitive',
  'design',
  'designing',
  'developers',
  'development',
  'digital',
  'directory',
  'dns',
  'documentum',
  'domino',
  'dotnetnuke',
  'drupal',
  'e-commerce',
  'e-learning',
  'e107',
  'easy',
  'edition',
  'email',
  'encoding',
  'enhancing',
  'enterprise',
  'espanol',
  'essentials',
  'evaluating',
  'examples',
  'execution',
  'firewalls',
  'forums',
  'foundation',
  'gdi+',
  'google',
  'guide',
  'gwt',
  'host',
  'how-to',
  'ideas',
  'imagemagick',
  'implementation',
  'implementing',
  'inside',
  'integrating',
  'integration',
  'invision',
  'ipcop',
  'iproute2',
  'italiano',
  'jakarta',
  'jasperreports',
  'java',
  'joomla',
  'kit',
  'l7-filter',
  'language',
  'learn',
  'learning',
  'linux',
  'lotus',
  'macro',
  'made',
  'mambo',
  'management',
  'manager',
  'managing',
  'mastering',
  'mediawiki',
  'merging',
  'microsoft',
  'migrating',
  'module',
  'modules',
  'moodle',
  'mysql',
  'nat',
  'netfilter',
  'networks',
  'notes',
  'office',
  'online',
  'ooobasic',
  'open',
  'opencms',
  'openofficeorg',
  'openswan',
  'openvpn',
  'oscommerce',
  'outlook',
  'pam',
  'pear',
  'performance',
  'php',
  'php-nuke',
  'phpbb',
  'phpeclipse',
  'planning',
  'plone',
  'pluggable',
  'portals',
  'portuguese',
  'power',
  'practical',
  'practice',
  'practices',
  'private',
  'process',
  'processing',
  'professional',
  'programmers',
  'programming',
  'project-based',
  'python',
  'qos',
  'quickly',
  'rapid',
  'reference',
  'remote',
  'responsive',
  'run',
  'sbs',
  'secure',
  'security',
  'seo',
  'server',
  'services',
  'set',
  'sistemas',
  'sistemi',
  'sitios',
  'small',
  'smarty',
  'soa-based',
  'software',
  'source',
  'sourcesafe',
  'spreadsheet',
  'ssl',
  'starter',
  'step-by-step',
  'stores',
  'struts',
  'sugarcrm',
  'sysadmins',
  'systems',
  'tcp/ip',
  'techniques',
  'telefonia',
  'telefonici',
  'telefónicos',
  'telephony',
  'template',
  'templates',
  'tips',
  'toolkit',
  'training',
  'tricks',
  'trixbox',
  'tutorial',
  'uml',
  'understanding',
  'upgrading',
  'user',
  'using',
  'vbnet',
  'video',
  'virtual',
  'virtualdub',
  'visual',
  'vpn',
  'web',
  'web-based',
  'website',
  'websites',
  'windows',
  'wordpress',
  'workflow',
  'xaml',
  'xoops',
);

$possibilities = array();

foreach ($terms as $term) {
  if (strpos($term, strtolower($_REQUEST['search-text'])) === 0) {
    $possibilities[] = "'". str_replace("'", "\\'", $term) ."'";
  }
}

print ('['. implode(', ', $possibilities) .']');
