String and Char count being displayed and I can’t fix
-
I am having a problem in displaying the results of the “calculation” as the php is printing the string and char count.
I am a total noob at php, The first set of code works and does what it is to do. but it is printing out the number of characters in each of the text strings.
I tested with some simple php and it does the echo as I would expect.
I have struggled with this a good part of the weekend and have had no luck in resolving this, so any help will be greatly appreciated.
// new date/time object $date = new DateTime('now'); // set order time to a Saturday, 2 pm $date->modify('next mon 14:00'); // orders are taken in till 15 minutes before 2pm // https://php.net/manual/de/datetime.formats.relative.php $order_till = new DateTime('front of 14'); // preserve original date $date_min = clone $date; // use interval //$date_min->add(new DateInterval("P1D")); // orders after 1:45 pm are getting shipped the next day if($date > $order_till) { $date_min->modify('0 weekdays'); } // if it's on a weekend then it gets shipped on monday if($date_min->format('N') >= 5){ $date_min->modify('next monday'); } // add delivery time $date_min->modify('1 weekdays'); var_dump('Order Before', $date->format('l jS \of F Y H:i:s')); var_dump("Delivery", $date_min->format('l jS \of F Y')); echo '<h2>PHP is Fun!</h2>'; echo 'Hello world!<br>'; echo 'Im about to learn PHP!<br>'; echo 'Delivery ', 'string ', 'was ', 'Order Before ', 'with multiple parameters.'; ?>
The code prints the following:
string(12) “Order Before” string(33) “Monday 11th of July 2022 14:00:00” string(8) “Delivery” string(25) “Tuesday 12th of July 2022”
PHP is Fun!
Hello world!
Im about to learn PHP!
Delivery string was Order Before with multiple parameters.`
- The topic ‘String and Char count being displayed and I can’t fix’ is closed to new replies.