Lecture 3 Hands-on Unix and PHP Goals: practice with Unix and PHP learning to use Unix man pages learning to use PHP.net documentation and examples /htdocs/courses/2013_spring/inls760_001/lect3 1. nano ^ is the control key ^W writes ^X exits 2. tar create: tar cvzf extract: tar xvzf 3. php arrays a. numeric array4.php b. associative array5.php c. multidimensional array6.php d. exercise how would we print out array6 if no print_r 4. review file and explode 5. Sorting a. asort http://www.php.net/manual/en/function.asort.php b. ksort http://www.php.net/manual/en/function.ksort.php c. usort http://www.php.net/manual/en/function.uasort.php d. multisort http://php.net/manual/en/function.array-multisort.php 6. Regular Expressions http://www.php.net/manual/en/reference.pcre.pattern.syntax.php http://php.net/manual/en/book.pcre.php http://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf http://www.cs.tut.fi/~jkorpela/perl/regexp.html a. syntax b. preg_match http://www.php.net/manual/en/function.preg-match.php c. preg_replace http://www.php.net/manual/en/function.preg-replace.php exercises: use wget to get a web page wikipedia disambiguation pages http://en.wikipedia.org/wiki/Vulcan_%28disambiguation%29 Project Gutenberg, Grimms Fairy Tales http://www.gutenberg.org/files/2591/2591-h/2591-h.htm read into an array in PHP using file now try to a. output lines with 'vulcan' b. output lines with 'Vulcan' or 'Vulcan' c. output parententical expressions on the page d. output the senses of vulcan 7. Finish Lect2 slides 8. VirtualBox + Ubuntu sudo apt-get upgrade sudu apt-get install ubuntu-desktop