NotionCommotion Posted July 7, 2016 Share Posted July 7, 2016 (edited) EDIT. Please disregard (and hopefully delete this post), I am just blind. I am logging data using Monolog. The following command: $this->logger->addInfo($this->server['ip'].' xxx '.$command.' xxx '."{$this->server['ip']}/$command"); produces the following log record: [2016-07-07 06:47:05] my_logger.INFO: http://sub.example.com xxx /task xxx http://sub.example.com//task [] [] What is causing the second forward slash between {$this->server['ip']} and /$command Edited July 7, 2016 by NotionCommotion Quote Link to comment https://forums.phpfreaks.com/topic/301439-php-string-adding-extra-forward-slash/ Share on other sites More sharing options...
QuickOldCar Posted July 7, 2016 Share Posted July 7, 2016 $command is returning /task So... don't add the slash as are doing. $this->logger->addInfo($this->server['ip'].' xxx '.$command.' xxx '."{$this->server['ip']}$command"); Quote Link to comment https://forums.phpfreaks.com/topic/301439-php-string-adding-extra-forward-slash/#findComment-1534309 Share on other sites More sharing options...
Solution NotionCommotion Posted July 7, 2016 Author Solution Share Posted July 7, 2016 So... don't add the slash as are doing. Yea, that was the reason I added "EDIT. Please disregard (and hopefully delete this post), I am just blind." to the original post. Quote Link to comment https://forums.phpfreaks.com/topic/301439-php-string-adding-extra-forward-slash/#findComment-1534312 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.