PHP Classes

File: exercise/sakila/sakila.php

Recommend this page to a friend!
  Packages of Jorge Castro   Chaos Machine One   exercise/sakila/sakila.php   Download  
File: exercise/sakila/sakila.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Chaos Machine One
Generate random data that obeys to formulas
Author: By
Last change:
Date: 9 months ago
Size: 1,253 bytes
 

Contents

Class file image Download
<?php

use eftec\PdoOne;
use
mapache_commons\Collection;
use
mapache_commons\Text;

include
"../../vendor/autoload.php";
include
"../Text.php";
include
"../Collection.php";
include
'SakilaLib.php';

$db=new PdoOne("mysql","localhost","root","abc.123","sakila");
$db->open();
$db->logLevel=3;



$txt="A Emotional Epistle of a Pioneer And a Crocodile who must Battle a Man in A Manhattan Penthouse";


$p=0;

$films=$db->select('description')->from('film')->toListSimple();
/*
$first=[];
foreach($films as $k=>$txt) {
    $r=explode(',',$txt);
    $first=array_merge($first,$r);
   
}

echo Collection::generateTable([$first]);
die(1);
*/
foreach($films as $k=>$txt) {
    echo
"<hr>";
   
   
$p=0;
   
$r=Text::between($txt, "A ", " of a ", $p, true);
   
$r=explode(' ',$r,2);
   
$first[$k][0]=$r[0];
   
$first[$k][1]=$r[1];
   
$first[$k][2]=Text::between($txt, " of a ", " and a ", $p, true);
   
$first[$k][3]=Text::between($txt, "and a ", " who ", $p, true);
   
$first[$k][4]=Text::between($txt, " who must ", " a ", $p, true);
   
$first[$k][5]=Text::between($txt, " a ", " in ", $p, true);
   
$first[$k][6]=Text::between($txt, " in ", "", $p, true);
   
var_dump($txt);
   
var_dump($first[$k]);

}
echo
Collection::generateTable($first);