Overview

Packages

  • Jyxo_Beholder
  • Jyxo_Charset
  • Jyxo_Color
  • Jyxo_Css
  • Jyxo_ErrorHandling
  • Jyxo_FirePhp
  • Jyxo_Gettext
    • Parser
  • Jyxo_Html
  • Jyxo_Input
    • Chain
    • Filter
    • Validator
  • Jyxo_Mail
    • Email
    • Parser
    • Sender
  • Jyxo_Rpc
    • Json
    • Xml
  • Jyxo_Shell
  • Jyxo_SpamFilter
  • Jyxo_Spl
  • Jyxo_String
  • Jyxo_Svn
  • Jyxo_Time
  • Jyxo_Timer
  • Jyxo_Webdav
  • Jyxo_XmlReader
  • PHP

Classes

  • Jyxo_Input_Filter
  • Jyxo_Input_Filter_AbstractFilter
  • Jyxo_Input_Filter_ExplodeName
  • Jyxo_Input_Filter_LowerCase
  • Jyxo_Input_Filter_Phone
  • Jyxo_Input_Filter_SanitizeUrl
  • Jyxo_Input_Filter_ToInt
  • Jyxo_Input_Filter_Trim

Interfaces

  • Jyxo_Input_FilterInterface

Exceptions

  • Jyxo_Input_Filter_Exception
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * Jyxo PHP Library
 5:  *
 6:  * LICENSE
 7:  *
 8:  * This source file is subject to the new BSD license that is bundled
 9:  * with this package in the file license.txt.
10:  * It is also available through the world-wide-web at this URL:
11:  * https://github.com/jyxo/php/blob/master/license.txt
12:  */
13: 
14: /**
15:  * Filter for splitting a name into first and second name.
16:  *
17:  * @category Jyxo
18:  * @package Jyxo_Input
19:  * @subpackage Filter
20:  * @copyright Copyright (c) 2005-2011 Jyxo, s.r.o.
21:  * @license https://github.com/jyxo/php/blob/master/license.txt
22:  * @author Jakub Tománek
23:  */
24: class Jyxo_Input_Filter_ExplodeName extends Jyxo_Input_Filter_AbstractFilter
25: {
26:     /**
27:      * Filters a value.
28:      *
29:      * @param mixed $in Input value
30:      * @return mixed
31:      */
32:     protected function filterValue($in)
33:     {
34:         $data = explode(' ', $in);
35: 
36:         $lastname = array_pop($data);
37:         $firstname = implode(' ', $data);
38: 
39:         $in = array(
40:             'firstname' => $firstname,
41:             'lastname' => $lastname
42:         );
43:         return $in;
44:     }
45: }
46: 
Jyxo PHP Library API documentation generated by ApiGen 2.3.0