Home Backend Development PHP Tutorial 关于STR REPLACE 不能替换多个字符的有关问题 求解

关于STR REPLACE 不能替换多个字符的有关问题 求解

Jun 13, 2016 am 10:38 AM
array line quot replace

关于STR REPLACE 不能替换多个字符的问题 求解
我用STR REPLACE 替换 例如第一个
echo "$uri/view/".trim(str_replace ( '%0A', '', rawurlencode($line))).'.html
帮%0A 替换成空 这个替换正常 而我现在需要一次性替换多个
代码如下
echo "$uri/view/".trim(str_replace (array("%0A",''),array("%0D",''), rawurlencode($line))).'.html
%0A 替换成空 成功 但是后面的替换%0D 却失效 求解
如何让这个代码 同时替换两个字符呢

------解决方案--------------------
echo "$uri/view/".trim(str_replace (array("%0A","%0D"),"", rawurlencode($line))).'.html
------解决方案--------------------
str_replace (array("%0A",''),array("%0D",''), rawurlencode($line))
=>
strtr (rawurlencode($line), array("%0A"=>'',"%0D"=>''))

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Sort array using Array.Sort function in C# Sort array using Array.Sort function in C# Nov 18, 2023 am 10:37 AM

Title: Example of using the Array.Sort function to sort an array in C# Text: In C#, array is a commonly used data structure, and it is often necessary to sort the array. C# provides the Array class, which has the Sort method to conveniently sort arrays. This article will demonstrate how to use the Array.Sort function in C# to sort an array and provide specific code examples. First, we need to understand the basic usage of the Array.Sort function. Array.So

How to use the REPLACE function to replace a specified part of a string in MySQL How to use the REPLACE function to replace a specified part of a string in MySQL Jul 25, 2023 pm 01:18 PM

MySQL is a commonly used relational database management system that provides a variety of functions to process and operate data. Among them, the REPLACE function is used to replace the specified part of the string. In this article, we will introduce how to use the REPLACE function for string replacement in MySQL and demonstrate its usage through code examples. First, let’s take a look at the syntax of the REPLACE function: REPLACE(str,search_str,replace_str).

Outsourcing takes the blame, Yahoo LINE leaks information of 57,000 employees Outsourcing takes the blame, Yahoo LINE leaks information of 57,000 employees Feb 15, 2024 am 11:30 AM

According to news from this website on February 14, Yahoo LINE announced today that a Korean outsourcing company was illegally accessed, and the information of about 57,000 LINE employees may have been leaked. It has not yet been confirmed whether any user or business partner information has been leaked. Following the leakage of user information by the LINE app in November 2023, the company's lax information management was exposed one after another. According to Yahoo LINE officials, between August and November 2023, two outsourcing Korean companies received unauthorized access and third-party intrusions, and the email addresses, phone numbers and photos of 57,611 employees were potentially leaked. It has not yet been confirmed whether secondary damage was caused by the use of employee information. Yahoo LINE announces its service in November 2023

What are the string search and replace techniques in Python? What are the string search and replace techniques in Python? Oct 20, 2023 am 11:42 AM

What are the string search and replace techniques in Python? (Specific code example) In Python, strings are a common data type, and we often encounter string search and replace operations in daily programming. This article will introduce some common string search and replacement techniques, accompanied by specific code examples. To find a specific substring in a string, you can use the find() method or index() method of the string. The find() method returns the index of the first occurrence of the substring in the string.

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

Simple and clear method to use PHP array_merge_recursive() function Simple and clear method to use PHP array_merge_recursive() function Jun 27, 2023 pm 01:48 PM

When programming in PHP, we often need to merge arrays. PHP provides the array_merge() function to complete array merging, but when the same key exists in the array, this function will overwrite the original value. In order to solve this problem, PHP also provides an array_merge_recursive() function in the language, which can merge arrays and retain the values ​​of the same keys, making the program design more flexible. array_merge

How to use the array_combine function in PHP to combine two arrays into an associative array How to use the array_combine function in PHP to combine two arrays into an associative array Jun 26, 2023 pm 01:41 PM

In PHP, there are many powerful array functions that can make array operations more convenient and faster. When we need to combine two arrays into an associative array, we can use PHP's array_combine function to achieve this operation. This function is actually used to combine the keys of one array as the values ​​of another array into a new associative array. Next, we will explain how to use the array_combine function in PHP to combine two arrays into an associative array. Learn about array_comb

What software is line? What software is line? Dec 24, 2020 pm 04:17 PM

Line is an instant messaging software launched by NHN Japan, the Japanese subsidiary of the Korean Internet group NHN. Its main functions include: 1. You can make free calls at any time when data traffic is activated or connected to wifi; 2. As long as it is a LINE smartphone Users can make free calls between users; 3. Stickers that can better express moods, etc.

See all articles