Your browser must have JavaScript enabled in order to view this page.
 >  >
 
Welcome Guest#9383 Login/register    Go to Bottom
Go to Top

Source for file dpmbstring_enabled.php

Documentation is available at dpmbstring_enabled.php

  1. <?php
  2. /**
  3.  * Maps dp_* to mb_* multibyte functions
  4.  *
  5.  * Used when DPSERVER_ENABLE_MBSTRING is set to TRUE in dpserver-ini.php and
  6.  * the multibyte extension is enabled in PHP.
  7.  *
  8.  * DutchPIPE version 0.4; PHP version 5
  9.  *
  10.  * LICENSE: This source file is subject to version 1.0 of the DutchPIPE license.
  11.  * If you did not receive a copy of the DutchPIPE license, you can obtain one at
  12.  * http://dutchpipe.org/license/1_0.txt or by sending a note to
  13.  * license@dutchpipe.org, in which case you will be mailed a copy immediately.
  14.  *
  15.  * @package    DutchPIPE
  16.  * @subpackage lib
  17.  * @author     Lennert Stock <ls@dutchpipe.org>
  18.  * @copyright  2006, 2007 Lennert Stock
  19.  * @license    http://dutchpipe.org/license/1_0.txt  DutchPIPE License
  20.  * @version    Subversion: $Id: dpmbstring_enabled.php 287 2007-08-21 18:47:19Z ls $
  21.  * @link       http://dutchpipe.org/manual/package/DutchPIPE
  22.  * @see        http://www.php.net/manual/en/ref.mbstring.php, dpserver-ini.php,
  23.  *              dpmbstring_disabled.php
  24.  * @since      DutchPIPE 0.4.0
  25.  */
  26.  
  27. /**
  28.  * Sends an email
  29.  *
  30.  * @param      string  $to          Receiver or receivers of the mail
  31.  * @param      string  $subject     Subject of the email to be sent
  32.  * @param      string  $message     Message to be sent
  33.  * @param      string  $addHeaders  Optional, inserted at end of email header
  34.  * @param      string  $addPara     Optional mail program parameters
  35.  * @return     boolean TRUE on success or FALSE on failure
  36.  * @see        http://www.php.net/manual/en/function.mail.php,
  37.  *              http://www.php.net/manual/en/function.mb-send-mail.php
  38.  */
  39. function dp_mail()
  40. {
  41.     $args func_get_args();
  42.     return call_user_func_array('mb_send_mail'$args);
  43. }
  44.  
  45. /**
  46.  * Gets string length
  47.  *
  48.  * @param      string  $string      The string being measured for length
  49.  * @param      string  $encoding    Optional character encoding
  50.  * @return     integer length of the given string
  51.  * @see        http://www.php.net/manual/en/function.strlen.php,
  52.  *              http://www.php.net/manual/en/function.mb-strlen.php
  53.  */
  54. function dp_strlen($string$encoding NULL)
  55. {
  56.     return is_null($encodingmb_strlen($string)
  57.         : mb_strlen($string$encoding);
  58. }
  59.  
  60. /**
  61.  * Finds position of first occurrence of a string
  62.  *
  63.  * @param      string  $haystack    The string to search in
  64.  * @param      string  $needle      The string to search for
  65.  * @param      string  $offset      Optional search offset, default is 0
  66.  * @param      string  $encoding    Optional character encoding
  67.  * @return     mixed   Position as an integer, or FALSE if needle was not found
  68.  * @see        http://www.php.net/manual/en/function.strpos.php,
  69.  *              http://www.php.net/manual/en/function.mb-strpos.php
  70.  */
  71. function dp_strpos($haystack$needle$offset NULL$encoding NULL)
  72. {
  73.     return is_null($encoding)
  74.         ? (is_null($offsetmb_strpos($haystack$needle)
  75.         : mb_strpos($haystack$needle$offset))
  76.         : mb_strpos($haystack$needle$offset$encoding);
  77. }
  78.  
  79. /**
  80.  * Finds position of last occurrence of a string
  81.  *
  82.  * @param      string  $haystack    The string to search in
  83.  * @param      string  $needle      The string to search for
  84.  * @param      string  $offset      Optional search offset, default is 0
  85.  * @param      string  $encoding    Optional character encoding
  86.  * @return     mixed   Position as an integer, or FALSE if needle was not found
  87.  * @see        http://www.php.net/manual/en/function.strrpos.php,
  88.  *              http://www.php.net/manual/en/function.mb-strrpos.php
  89.  */
  90. function dp_strrpos($haystack$needle$offset 0$encoding NULL)
  91. {
  92.     return is_null($encoding)
  93.         ? (is_null($offsetmb_strrpos($haystack$needle)
  94.         : mb_strrpos($haystack$needle$offset))
  95.         : mb_strrpos($haystack$needle$offset$encoding);
  96. }
  97.  
  98. /**
  99.  * Gets part of a string
  100.  *
  101.  * @param      string  $string      The input string
  102.  * @param      string  $start       Start position
  103.  * @param      string  $length      Optional length modifier
  104.  * @param      string  $encoding    Optional character encoding
  105.  * @return     string  Extracted part of string
  106.  * @see        http://www.php.net/manual/en/function.substr.php,
  107.  *              http://www.php.net/manual/en/function.mb-substr.php
  108.  */
  109. function dp_substr($string$start$length NULL$encoding NULL)
  110. {
  111.     return is_null($encoding(is_null($lengthmb_substr($string$start)
  112.         : mb_substr($string$start$length))
  113.         : mb_substr($string$start$length$encoding);
  114. }
  115.  
  116. function dp_strtolower($string$encoding NULL)
  117. {
  118.     return is_null($encodingmb_strtolower($string)
  119.         : mb_strtolower($string$encoding);
  120. }
  121.  
  122. function dp_strtoupper($string$encoding NULL)
  123. {
  124.     return is_null($encodingmb_strtoupper($string)
  125.         : mb_strtoupper($string$encoding);
  126. }
  127.  
  128. function dp_substr_count($haystack$needle$encoding NULL)
  129. {
  130.     return is_null($encoding?
  131.         mb_substr_count($haystack$needle)
  132.         : mb_substr_count($haystack$needle$encoding);
  133. }
  134.  
  135. function dp_ereg($pattern$string$regs NULL)
  136. {
  137.     return is_null($regsmb_ereg($pattern$string)
  138.         : mb_ereg($pattern$string$regs);
  139. }
  140.  
  141. function dp_eregi($pattern$string$regs NULL)
  142. {
  143.     return is_null($regsmb_eregi($pattern$string)
  144.         : mb_eregi($pattern$string$regs);
  145. }
  146.  
  147.  
  148. function dp_ereg_replace($pattern$replacement$string$option NULL)
  149. {
  150.     return is_null($optionmb_ereg_replace($pattern$replacement$string)
  151.         : mb_ereg_replace($pattern$replacement$string$option);
  152. }
  153.  
  154. function dp_eregi_replace($pattern$replacement$string$option NULL)
  155. {
  156.     return is_null($optionmb_eregi_replace($pattern$replacement$string)
  157.         : mb_eregi_replace($pattern$replacement$string$option);
  158. }
  159.  
  160. function dp_split($pattern$string$limit NULL)
  161. {
  162.     return is_null($limitmb_split($pattern$string)
  163.         : mb_split($pattern$string$limit);
  164. }
  165. ?>

Documentation generated on Mon, 03 Sep 2007 22:19:46 +0200 by phpDocumentor 1.3.0RC6

Click me!
Guest#9383
 
 
 
  Go to Top
 
 
Input Field OptionsClose Input Field Go to Top
 
Legal Notices | Copyright © 2006, 2007 Lennert Stock. All rights reserved. Last update: Mon Sep 03 2007, 21:50 CET.