PhpRiot
Follow phpriot on Twitter
Sponsored Link
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
Free iPad/iPhone App
Available on the App Store

  • PHP manual
  • Zend Framework manual
  • Smarty manual
  • PHP articles
  • PHP training

StringToUpper

This filter converts any input to be uppercased.

Supported options for Zend_Filter_StringToUpper

The following options are supported for Zend_Filter_StringToUpper:

  • encoding: This option can be used to set an encoding which has to be used.

Basic usage

This is a basic example for using the StringToUpper filter:

<?php
$filter 
= new Zend_Filter_StringToUpper();

print 
$filter->filter('Sample');
// returns "SAMPLE"

Different encoded strings

Like the StringToLower filter, this filter handles only characters from the actual locale of your server. Using different character sets works the same as with StringToLower.

<?php
$filter 
= new Zend_Filter_StringToUpper(array('encoding' => 'UTF-8'));

// or do this afterwards
$filter->setEncoding('ISO-8859-1');

Zend Framework