PHP, More on the Inverted Index ADT




CS267

Chris Pollett

Sep 10, 2018

Outline

Introduction

Introduction to PHP

Getting and Running PHP

Example PHP file

Consider the file test.php:

hello world
<?php
echo "hello world";
?>
yeah!!
<?php
echo "okay";

If we ran this from the command line using:

php test.php

This would output:

hello world
hello worldyeah!!
okay

More On PHP

Configuring PHP

PHP configuration

You can see what PHP's configuration settings are in use by the following small program

<?php
phpinfo();

Primitives and Variables

Integer, String, and Boolean Type

Arithmetic Operators,etc

Control Statements

Arrays

More on PHP Arrays

Yet More on PHP Arrays

Functions

Quiz

Which of the following is true?

  1. The nextPhrase(t[1],t[2], .., t[n], position) algorithm given in class made use of the Inverted Index ADT's next, prev methods.
  2. In a Markov Model the values on the transitions coming into a vertex must sum to 1.
  3. Yioop is written in C#.

Variable Scope

Built-in Globals

File Reading

ADT Example: Phrase Search

Generating all Occurrences.

Implementing our ADT.

More on Implementing next and prev