PHP kullanarak kodlamayı kaldırmak

3 Cevap php

Ben aşağıdaki metni var:

We%27re%20proud%20to%20introduce%20the%20Amazing

Ben PHP kullanarak kodlamayı kaldırmak istiyorum, ama html_entity_decode() çalışmaz kullanarak.

Herhangi bir öneriniz?

3 Cevap

echo urldecode('We%27re%20proud%20to%20introduce%20the%20Amazing');

Bu url_ecoded dizedir. Kullan urldecode

Bu kodlama Percent encoding veya URL kodlama denir. PHP Eğer rawurlencode , rawurldecode for “raw” URL encoding as well as the urlencode and urldecode for the slightly different encoding that is used in the query (rather known as application/x-www-form-urlencoded where the space is encoded with + yerine {[var (7)]}).

Senin durumunda "ham" URL kodlaması kullanılır. Yani rawurldecode bunu çözmek için deneyin:

rawurldecode('We%27re%20proud%20to%20introduce%20the%20Amazing')

% 27 ve% 20 URL kodlanmış kişiler vardır.

Sen kullanımını urldecode() Bu çözmek için kullanmak isteyeceksiniz. urlencode() URL parametreleri kodlama için de mevcuttur.