Archive for the ‘PHP’ Category

PHP: Let Your Properties be Properties

There is a coding pattern that I see (and have used) in PHP code that defines generic methods on a class for setting and getting properties. function set($name, $value); function get($name); Google code search for examples Some times there are some ancillary methods to deal with unsetting, checking for existence, setting via an array, or [...]

Benchmarking PHP’s Magic Methods

Larry Garfield has an interesting set of benchmarks covering many of PHP’s magic methods. His results correspond pretty well to my own benchmarks in the area. The thing to take away is that its not necessarily the overhead of the magic methods, but rather what you do inside them. Its hard to do anything useful [...]

Closures are coming to PHP

Dagfinn has a post looking at using the new closure feature of PHP 5.3. He compares using foreach for iteration versus array_map. “Interesting,” he concludes, “but not necessarily better than conventional alternatives.” I agree for that case. Consider instead, a more complicated operation that requires a setup and a tear down after. setup(); operation(); teardown();

How to Draw pie chart in PHP

How to Draw pie chart in PHP <?php $myImage = ImageCreate(300,300); $white = ImageColorAllocate ($myImage, 255, 255, 255); $red = ImageColorAllocate ($myImage, 255, 0, 0); $green = ImageColorAllocate ($myImage, 0, 255, 0); Incoming search terms:pie chart in php (2)<?php $myImage = ImageCreate(300 300); $white = ImageColorAllocate ($myImage 255 255 255); (1)draw a pie chart in [...]

A Dynamic Bar Chart in PHP

A Dynamic Bar Chart in PHP <?php header(“Content-type: image/gif”); $cells = array ( liked=>200, hated=>400, indifferent=>900 ); $max = max( $cells ); Incoming search terms:dynamic bar chart in php (5)dynamic bar graph in html (1)dynamic bar graph in php (1)dynamic bar graphs in php (1)dynamic barchart in php (1)how i create dynamic chart in php [...]

Powered by WordPress | Designed by: best suv | Thanks to trucks, infiniti suv and toyota suv