How to display after 4 week dates? I want to pass an argument

echo date( "F jS, Y" , strtotime("now +3 weeks") );

It gives the result as July 2, 2010. Fine.Now, I want to pass an argument as follows.

Original print_r($originalamount) give a result like this

Array ( 
      [0] => 4 Months
      [1] => 3500 
)

My code

 $text=trim($originalamount[0]);
 $text1="now +".$text;

 echo date( "F jS, Y" , strtotime($text1)) ;

This parish came out

December 31st, 1969 

I do not know why.

alt text

+3
source share
1 answer

I just tried ...

$originalamount[0] = '4 Months';

$text=trim($originalamount[0]);
$text1="now +".$text;

echo date( "F jS, Y" , strtotime($text1)) ;

And it works great ...

October 11th, 2010 

Can you give us var_dump $originalamount, is there any other code that could be messing around with$originalamount

+3
source

Source: https://habr.com/ru/post/1749614/


All Articles