Let's say I want to send the effect through a function argument, can I also send the additional arguments through that as well, can't really explain it, here is how I would imagine it.
<?php
//Apply photo effects
function applyEffect($url,$effect) {
//List valid effects first
$img = imagecreatefromjpeg($url);
//Testing
if($img && imagefilter($img, $effect)) {
header('Content-Type: image/jpeg');
imagejpeg($img);
imagedestroy($img);
} else {
return false;
}
}
applyEffect("http://localhost:1234/ppa/data/images/18112013/0/image3.jpg",IMG_FILTER_BRIGHTNESS[20]);
?>
As you can see I pass IMG_FILTER_BRIGHTNESS through the function arguments, but the filter i'm using needs an additional argument which it would be nice to send when I call the applyEffect function, like so: IMG_FILTER_BRIGHTNESS[20]
But this does not work, any pointers?
function applyEffect($url,$effect,$arg1,$arg2,$arg3) {function foo($arg1, $arg2=null, $arg3=null) {