KBD

Keith Devens .com

Friday, May 16, 2008 Flag waving
A charlatan makes obscure what is clear; a thinker makes clear what is obscure. – Hugh Kingsmill

PHP

PHP is an HTML-embedded, server-side scripting language. It runs everywhere, and does the same stuff that ASP, JSP, etc. do, but (usually) better. Wikipedia is written in it, Yahoo uses it, and so on. It basically works and doesn't get in my way too much. PHP the language is pretty terrible and inconsistent, but the platform as a whole adds up to making PHP a very good tool.

Inconsistencies

I can never remember the argument order of many of the functions in PHP, mostly because they're inconsistent. So, here's a quick reference of the problem functions:

Functions that take $haystack, $needle:

http://php.net/strpos
http://php.net/strstr

Functions that take $needle, $haystack:

http://php.net/in_array
http://php.net/array_search

Functions that take $callback, $array:

http://php.net/array_map

Functions that take $array, $callback:

http://php.net/array_walk
http://php.net/usort

Code Snippets

How I do templating in PHP:

<?php
function template($name$args=NULL){
    
$er error_reporting(E_ALL&~E_NOTICE&~E_WARNING);
    
extract($argsEXTR_REFS);
    
$return = include(TEMPLATE_DIR.'/'.$name.'.php');
    
error_reporting($er);
    return 
$return;
}
?>

Page last edited: February 19, 2006 (utc)

Index

A B C D E F G H I J L M N O P R S T U V W X

All pages

A

  1. About
  2. Acno's Energizer
  3. Artificial Intelligence
  4. ASP.NET
  5. Atom

B

  1. Bash
  2. Belief systems
  3. Bookmarklets
  4. Build tools

C

  1. C and C++
  2. C#
  3. C++ Reference
  4. Calvinism
  5. Cars I want to consider
  6. CGI
  7. character sets
  8. Chess
  9. Christian Reconstruction
  10. Christian Resources
  11. Chronicles of Narnia
  12. Color tools
  13. Computer Science
  14. Cornelius Van Til
  15. CSS - Cascading style sheets
  16. CSSTabs

D

  1. Database
  2. Differencing programs
  3. Documentation standards
  4. Downloads
  5. Dualities
  6. Dvorak keyboard

E

  1. E-mail me
  2. Eclipse
  3. Eiffel
  4. Emacs
  5. Evolution
  6. Extension languages

F

  1. File extensions
  2. Firefox
  3. Formation: web form automation library for PHP
  4. Forth

G

  1. Greg Bahnsen
  2. GUI Toolkits
  3. Guns

H

  1. Hex editors

I

  1. Important articles or essays
  2. Installers
  3. Internet radio stations

J

  1. Java
  2. Javascript
  3. jEdit

L

  1. Linux
  2. Lisp
  3. Logical fallacies
  4. Lua

M

  1. Markup
  2. Miscellaneous Links
  3. mod_rewrite
  4. Movie theaters
  5. My comment policy
  6. My essential programs
  7. My resume

N

  1. Namespaces
  2. Naming conventions
  3. New Years 2000
  4. N^2 sort comparison

O

  1. Open Source License
  2. OPML

P

  1. Perl
  2. Philosophy
  3. PHP
  4. PHP Calendar (version 2.3)
  5. PHP XML Library, version 1.2b
  6. Pictures
  7. Postmillenialism
  8. Presuppositionalism
  9. Programming Fonts
  10. Programming languages
  11. Programming Resources
  12. Punta Cana
  13. Python

R

  1. RDF
  2. REBOL
  3. Reflex game
  4. Regular expressions
  5. Religion
  6. RFCs
  7. Robot Exclusions
  8. Roman Catholicism
  9. Ruby

S

  1. Scala programming language
  2. Science
  3. Shorthand
  4. Skydiving, August 28, 2000
  5. Software I've written
  6. SPAM
  7. SQLite
  8. StructuredText

T

  1. Tabs vs Spaces
  2. Tcl/Tk
  3. Tea
  4. Text Editors
  5. TextDrive
  6. The Big Bang
  7. The naked street
  8. Theonomy
  9. Tools of communication

U

  1. Unicode
  2. URL Design

V

  1. Version control systems
  2. VI text editor
  3. Virtual machines

W

  1. WeblogUrls
  2. Wiki
  3. WikiBlogIntegration
  4. World of Warcraft
  5. wxWidgets

X

  1. XHTML
  2. XML
  3. XML to PHP translator
  4. XML-RPC
  5. XML-RPC Library for PHP (v 2.5)

Generated in about 0.051s.

(Used 4 db queries)