pluses are getting stripped from GET variable in php [duplicate] - php

This question already has answers here:
PHP - Plus sign with GET query
(6 answers)
When should space be encoded to plus (+) or %20? [duplicate]
(5 answers)
Closed 3 years ago.
First of all thanks in advance to everyone helping me out with my question.
I've got a base64_encoded string that looks like:
$_GET['val']='8AH1Oc+gqwjMPyyAL+PIu2neFF5C+bQAkDf/FJdApT4AC09jD/o9I3vHs0cIPC8678TzuFMVlZd+7zA/fV1b9OEF0Uwnao3aURtGUkbx4NoEQFvQ1hBPy0EbUobbRQO/WojW9F6oowS/yX+I+qj53N4nORxhKJRDzMIQO1W8sOSH1BkBHsCotG1dj813OWLoBLy+K9ABLBqUta9+0Mk3JCg+wO/WA2Bh06M0n4ux+qk=';
but when im trying to get the same variable to decode it i recieve it with pluses removed:
$string=$_GET['val'];
echo $string; // either echo $_GET['val']; output will be '8AH1Oc gqwjMPyyAL PIu2neFF5C bQAkDf/FJdApT4AC09jD/o9I3vHs0cIPC8678TzuFMVlZd 7zA/fV1b9OEF0Uwnao3aURtGUkbx4NoEQFvQ1hBPy0EbUobbRQO/WojW9F6oowS/yX I qj53N4nORxhKJRDzMIQO1W8sOSH1BkBHsCotG1dj813OWLoBLy K9ABLBqUta9 0Mk3JCg wO/WA2Bh06M0n4ux qk='
Could somebody please explain why does it happen?

Related

How do I translate these weird UTF-8 "from" strings in e-mail context? [duplicate]

This question already has answers here:
decode a quoted printable message in php
(1 answer)
Decoding "=C3=A4" in a string
(1 answer)
Closed 3 years ago.
Receiving e-mails, I end up with "complete from strings" such as this one:
$test = '=?UTF-8?Q?Test=C3=B6p?= <no-reply#Testöp.tld>';
How do I get rid of the "=?UTF-8?" nonsense? Obviously I don't mean to just string-replace it, but to convert it properly to an actual UTF-8 string. It's supposed to be something like:
$test = 'Testöp <no-reply#Testöp.tld>';
I don't know why I get this in the first place, but I bet there is a simple function to do it somewhere in PHP.
Note: It's not utf8_decode()! That one does nothing to that string!

How get the decoded contents sent to php server? [duplicate]

This question already has an answer here:
decoding eval(base64_decode))
(1 answer)
Closed 3 years ago.
I have the following encoded codes! It will decode itself and run with eval() function, is any solution to get the decoded codes that run by server?!
<?php /*** PHP Encode v1.0 by zeura.com ***/ $XnNhAWEnhoiqwciqpoHH=file(__FILE__);eval(base64_decode("aWYoIWZ1bmN0aW9uX2V4aXN0cygiWWl1bklVWTc2YkJodWhOWUlPOCIpKXtmdW5jdGlvbiBZaXVuSVVZNzZiQmh1aE5ZSU84KCRnLCRiPTApeyRhPWltcGxvZGUoIlxuIiwkZyk7JGQ9YXJyYXkoNjU1LDIzNiw0MCk7aWYoJGI9PTApICRmPXN1YnN0cigkYSwkZFswXSwkZFsxXSk7ZWxzZWlmKCRiPT0xKSAkZj1zdWJzdHIoJGEsJGRbMF0rJGRbMV0sJGRbMl0pO2Vsc2UgJGY9dHJpbShzdWJzdHIoJGEsJGRbMF0rJGRbMV0rJGRbMl0pKTtyZXR1cm4oJGYpO319"));eval(base64_decode(YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH)));eval(ZsldkfhGYU87iyihdfsow(YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH,2),YiunIUY76bBhuhNYIO8($XnNhAWEnhoiqwciqpoHH,1)));__halt_compiler();aWYoIWZ1bmN0aW9uX2V4aXN0cygiWnNsZGtmaEdZVTg3aXlpaGRmc293Iikpe2Z1bmN0aW9uIFpzbGRrZmhHWVU4N2l5aWhkZnNvdygkYSwkaCl7aWYoJGg9PXNoYTEoJGEpKXtyZXR1cm4oZ3ppbmZsYXRlKGJhc2U2NF9kZWNvZGUoJGEpKSk7fWVsc2V7ZWNobygiRXJyb3I6IEZpbGUgTW9kaWZpZWQiKTt9fX0=c86f0c50b87a0b21633e9a7752465da7914bc8bbbZJRa8IwFIXfBf9DLGOJoO3co6NuMgbbg8wH3+Yoobm10ZiEJGXq2H9f0qpQ6dNNz739cnISRh1kDApaCZc5voeTkpBZcATPLafJCkpDJR4+9Xu8QGRQcAEZHLh1luAFZSC4hKVRTsVCbfBwiH77PYQq6fVd54Qn/fV7Xbj9eTjWpb6SEMqVPhJcOqftNEl0SU18mdQ19nA8Ja1/R+iG1ezJZS4qBjdN37tr2UQpkvCD1oxKtVm3Wuv58oPgN8GPdLW4uqj5bcZ4Zh01jtSdEKuHMh81id6nPKpVHyvzaihkMpo8PnRR8pJKCcKOZ1vF5WvzRb7wWcconSH80hgCusDfAVIHFoXAfF5U8zGEvtvHeZH4K1AqnPsZigJyl9Y+7h0c/DIYjUY4lHirN53n0qUv3k+lhaLMi+EKl0H0tsK68XRl1I4gLxXCn7tBSPvyNsAYZbLmTfwD
Have you tried to do this:
echo base64_decode("aWYoIWZ1bmN0aW9uX2V4aXN0cygi ...
?
You should see the encoded code.

How to decode Ascii code in a Character in PHP [duplicate]

This question already has answers here:
URL Decoding in PHP
(6 answers)
Closed 6 years ago.
I got the string in this format
solr/?key=color&facet=Blue%26keyword%3Dwoo
However, I want to get it in this format
solr/?key=color&facet=Blue&keyword=woo
Try urldecode:
$url = urldecode("solr/?key=color&facet=Blue%26keyword%3Dwoo");
// = solr/?key=color&facet=Blue&keyword=woo

PHP decoding html encoded characters [duplicate]

This question already has answers here:
URL Decoding in PHP
(6 answers)
Closed 6 years ago.
I have problem decoding html encoded character using php, what should i do?
Below is the sample input.
%D8%A7%D8%AB%D8%A7%D8%B1%D9%87 %D8%A7%D9%84%D9%85%D8%B1%D9%87
Below is the sample output i want.
اثاره المره
Use PHP's urldecode function:
urldecode("%D8%A7%D8%AB%D8%A7%D8%B1%D9%87 %D8%A7%D9%84%D9%85%D8%B1%D9%87");

Using PHP to find the number inside {{2461245}} [duplicate]

This question already has answers here:
PHP Extract numbers from a string
(8 answers)
Closed 7 years ago.
What is the best way to extract the number in the following string:
"This is a test string {2461245} and I need to extract the number"
Thank you.
This should help you :
$myText = 'This is a test string {2461245} and I need to extract the number';
preg_replace("/[^0-9]/","",$myText);
What you are saying there is : I want to replace everything which is not a number in the myText variable by "", which means everything which will stay in the end is your number.

Categories