PHP




CS267

Chris Pollett

Sep 9, 2019

Outline

Introduction

Configuring Your Crawl

Crawl Options

Page Options

Other Things Yioop Can Do

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. Zipf's law for terms in a corpus says that the frequency of the `i`th most common term, `F_i`, will be proportional to `1/(i^\alpha)` for some constant `\alpha`.
  2. Every Markov Model is equivalent to a first-order language model.
  3. Yioop uses the same process to schedule what to crawl next as it does to download web pages.

Variable Scope

Built-in Globals

File Reading