This question already has answers here:
Convert one date format into another in PHP
(17 answers)
Closed 5 years ago.
How will i remove the 0 in my output i tried this code.
$dates="2017-09-08";
$formated_date=date("d-m-Y", strtotime($dates));
Output:08-09-2017
My Expected Output : 8-9-2017
$dates="2017-09-08";
$formated_date=date("j-n-Y", strtotime($dates));
USE THIS
Related
This question already has answers here:
How to convert float value to integer in php?
(6 answers)
Closed 4 years ago.
How to convert non-integrated numbers like this: 415.822948 to be integrated exactly like: 415 using PHP?
You can use the intval() function for this.
Here's an example:
echo intval(415.822948);
This will output: 415
This question already has answers here:
How to convert JavaScript code to its PHP equivalent?
(1 answer)
UTF-8 all the way through
(13 answers)
Closed 5 years ago.
I have php code:
$b = 'aHR0cDovL3d3dy5oZHpvZy5jb20vZ2V0X2ZpbGUvМS84Y2Е5МTЕ4ZmМyNmVkNTk0ZmI5Yzc2ZWI2Y2Y2YWVmМС85NDАwМС85NDU4Ny85NDU4Ny5tcDQvP3RpbWU9МjАxNzА5МjYyМDIxNDYmcz05МTUzZmNmYjАyOTUyOWQxY2JhZTВkYzNkY2ZhODVmZiZicj0xODЕ1JmQ9МTcwNyZmPXZpZGVvLm0zdTg~';
echo substr($b,40,1);
But it not print M charater. It show '�' . Why?
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
This question already has answers here:
file_get_contents('php://input'); with application/x-www-form-urlencoded;
(3 answers)
Closed 7 years ago.
I am using json_decode on file_get_contents("php://input") but I get null every time.
I output file_get_contents("php://input") and got output in this format a=1&b=2.
How can I convert this to an array?
Why json_decode?! Use parse_str
This question already has answers here:
Parse query string into an array
(12 answers)
Closed 7 years ago.
This is the value i get from db.
pkid=1&ordernumber=54322&ordervalue=12345&response=2&scheduleId=1
Want to extract response from this.That is 2.
Here it is
$str ='pkid=1&ordernumber=54322&ordervalue=12345&response=2&scheduleId=1';
parse_str($str);
echo $response; // output :- 2