Categories
Server

Command Not Found…All of a sudden a command is not Found!

Command Not Found: You’ve been having a good day up till now When you type a common command in unix, it could be ls or last or who or grep or in my case rmate when low and behold, a response: bash: Command not Found This is very annoying and is often the case where […]

Categories
Zend Framework 1.12

Add Events to Zend_Forms Zend Framework

$type = new Zend_Form_Element_Select(‘type’,array(‘onchange’ => ‘alert(“working”)’));

Categories
PHP 5

using PHP Values as Variable names and to call Functions

This should apply to perl as well: Variable name: $myvar = ‘foo’; ${$myvar} = ‘haswell’; echo $foo RESULT ‘haswell’ Call a function: $type = ‘red’; $myClass->$type(); == $myClass->red(); Taken from: More helpful stuff: ${“variableName”} = 12; {“functionName”}(); $className->{“variableName”}; $className->{“methodName”}(); StaticClass::${“variableName”}; StaticClass::{“methodName”}(); Are there any other Languages that can do this, I know Perl Can… And […]

Categories
PHP

Loop Through an Associative Array PHP

foreach (array_expression as $key => $value) { echo $key; }

Categories
Zend Framework 1.12

Populate a single field in a form Zend Framework

$form->populate(array(“id” => $id));