PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

UpperCase filter

The UpperCase filter allows to change the content of a file to uppercase. You should use this filter only on textfiles.

At initiation you can give a string which will then be used as encoding. Or you can use the setEncoding() method to set it afterwards.

Example 437. Using the UpperCase filter

<?php
$upload 
= new Zend_File_Transfer_Adapter_Http();
$upload->addValidator('MimeType''text');

// Adds a filter to uppercase the uploaded textfile
$upload->addFilter('UpperCase');

// Adds a filter to uppercase the uploaded file but only for uploadfile1
$upload->addFilter('UpperCase'null'uploadfile1');

// Adds a filter to uppercase with encoding set to ISO-8859-1
$upload->addFilter('UpperCase''ISO-8859-1');

Note

Note that due to the fact that the options for the UpperCase filter are optional, you must give a NULL as second parameter (the options) when you want to limit it to a single file element.

Zend Framework