You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

New Proposed PHP Functions

Posted by Keith Elder | Posted in Funny Stuff, Open Source, PHP, Programming | Posted on 04-04-2002

These are a little late for April fools day, but none-the-less these are funny. We made these up whilst sitting around the office back in the summer. I thought I would put them out now, we’ve had them long enough. Hope you have a good laugh.

Proposed new PHP functions

In response to many recent projects, we’d like to propose some new PHP functions to help speed development time.


$task is any task that needs to be done.?? Always returns TRUE.

$discount = i_wanna(“give my friends a 20% discount on some items in my store”);


A modifier to be used as a conjunction between control structures and those difficult to define conditions.? Normal use would require the logical reasoning (plain English is allowed right now, we’ll need language packs to internationalize this) to follow the because keyword.? In cases where there is no logical reasoning, you must use just_because.

print “You need to use IE5” because our “web designers” don’t know anything besides IFRAME and MARQUEE.

This works just as well…
print “You need to use IE5” just_because


A simple function that will modify the behaviour and logic of the current PHP page to behave and appear like the supplied URL.? For projects where a client is constantly saying “but http://www.foobar.com has a really cool log in page!”, you can simply have PHP emulate the features of the specified URL at foorbar.com


// my current page isn’t very good
// and I want to be like an awesome Cold Fusion site
?$newPage = beLike(“http://www.awesomeCFsite.com“);
?echo $newPage;



This function always returns a true, to make upper management happy.? The external application can be pretty much anything you need to integrate with – PHP can integrate with just about any application out there.? Linux, Windows, Sun, HP-UX, Mac, etc. – integrate_with() will make it happen.


?$didIntegrate = integrate_with(“c:program filescrystal reportsJane’s reports*”);
?echo $didIntegrate;

?$didIntegrate = integrate_with($clientJavaSystem);
?echo $didIntegrate;

Note that in the first example, you may need to escape the ‘ in any string passed to integrate_with(). This will addressed in future versions.? Use on Windows systems may need long file names translated to DOS 8.3 format.



Again, this always returns a boolean.? Similar to integrate_with, but with a broader purpose, add_solution() allows you to easily add new industry standard solutions as they are developed (in some cases, beforehand – that’s the power of open source).?


$newSolution = add_solution(E_BUSINESS);
echo “$newSolution has been added to your site”;

As you can see, add_solution can be a powerful way to add new solutions to your site.? Current valid parameters (please use the system-defined constants for now) are limited to:

E_BUSINESS – an all-ecompassing e-business solution.
E_COMMERCE – a subset of the E_BUSINESS solution system.?
XML – more limited than the E_BUSINESS solution – often used in conjunction with integrate_with()
EDI – similar to XML, but for legacy systems
J2EE – similar functionality to E_BUSINESS
COM – used when adding solutions for Windows shops
TURNKEY – easily the most popular, for clients needing a turnkey solution.

Write a comment