PHP字符串替换函数
str_replace函数
描述:实现字符串替换,区分大小写
语法:mixed str_replace(mixed $search, mixed replace, mixed $subject, [int &$count]);
$str = 'javascript';
echo str_replace('a','b',$str);
//我要替换谁? a ,替换成什么 b, 替换哪个字符串?$str
//但如果我写了一个A, 结果是没有替换的,因为$str里面没有大写字母A 反之,如果用str_ireplace('A','b',$str)就能实现
str_ireplace函数
描述:实现字符串替换,不区分大小写
语法:mixed str_ireplace(mixed $search, mixed replace, mixed $subject, [int &$count]);
PHP字符串替换函数的更多相关文章
- JS字符串替换函数:Replace(“字符串1″, “字符串2″),
JS字符串替换函数:Replace(“字符串1″, “字符串2″), 1.我们都知道JS中字符串替换函数是Replace(“字符串1″, “字符串2″),但是这个函数只能将第一次出现的字符串1替换掉, ...
- sql server 字符串替换函数REPLACE
sql server 字符串替换函数REPLACE函数的使用 <pre name="code" class="sql">--参数1:需要替换字符的母 ...
- php中几个字符串替换函数详解
在php中字符替换函数有几个如有:str_replace.substr_replace.preg_replace.preg_split.str_split等函数,下面我来给大家总结介绍介绍. 一.st ...
- sql server 数据字符串替换函数
sql server 替换函数 replace 函数参数 REPLACE(string_expression, string_pattern, string_replacement) 1.string ...
- Java字符串替换函数replace、replaceFirst、replaceAll
一.replace(String old,String new) 功能:将字符串中的所有old子字符串替换成new字符串 示例 String s="Hollow world!"; ...
- PHP字符串替换函数strtr()
strtr函数比str_replace函数的效率要高很多,strtr()的两种定义方式: strtr(string, from, to)和strtr(string, array)1.strtr区分大小 ...
- string类自定义字符串替换函数replace
#include <iostream> #include <string> using namespace std; /* * 函数功能:将string字符串中的某些字符替换 ...
- PHP序列号生成函数和字符串替换函数代码
/** * 序列号生成器 */ function snMaker($pre = '') { $date = date('Ymd'); $rand = rand(1000000,9999999); $t ...
- java 字符串替换函数replaceAll 一次同时替换多个字符串
public static void main(String[] args) throws Exception { String src = "南京市玄武区北京东路徐州市鼓楼区戏马台&quo ...
随机推荐
- poj1019(打表预处理+数学)
题目链接:http://poj.org/problem?id=1019 题意:对于序列1121231234...,求第i个数字(i<=2147483647). 思路:记第一组为1,第二组为12, ...
- Zabbix 3.0编译安装
环境准备Centos 6.X 数据库准备默认centos yum源中mysql包的版本号为5.1,为了能使zabbix 3.0能达到最好的性能效果,安装最新版的mysql数据库. yum list i ...
- DialogFragment 对话框 碎片
package com.example.m_evolution; import android.app.Dialog; import android.app.DialogFragment; impor ...
- socket、fsockopen、curl、stream 区别
socket 水泥.沙子,底层的东西fsockopen 水泥预制件,可以用来搭房子curl 毛坯房,自己装修一下就能住了 水泥.沙子不但可以修房子,还能修路.修桥.大型雕塑.socket也是,不但可以 ...
- ubuntu下手动安装php-amqp模块教程
用于ubuntu的默认源里面没有php5-amqp这个包,所以要用上amqp得考手动编译. 参考手册 http://php.net/manual/pl/book.amqp.php 首先安装必须的php ...
- c#: TabControl隐藏选项卡(WizardPages)
如Delphi之TPageControl控件,其TTabSheet有TabVisible属性,在制作类似Wizard页面切换时,甚为有用. 而c#对应之TabControl控件,其页面TabPage无 ...
- python中if not x: 和 if x is not None: 和 if not x is None的使用和区别
代码中经常会有变量是否为None的判断,有三种主要的写法: 第一种是`if x is None`: 第二种是 `if not x:`: 第三种是`if not x is None`(这句这样理解更清晰 ...
- [leetcode]252. Meeting Rooms会议室有冲突吗
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si ...
- 先安装win7时IIS的安装
打开“控制面板”->选择“程序”->选择“打开或关闭windows功能”->在“Internet信息服务”中勾选以下勾选框
- Java并发-ConcurrentModificationException原因源码分析与解决办法
一.异常原因与异常源码分析 对集合(List.Set.Map)迭代时对其进行修改就会出现java.util.ConcurrentModificationException异常.这里以ArrayList ...