Skip to content

Tag: php

Add days to date in Laravel

I am beginner in Laravel. I use in my project Laravel 5.8. I have this code: How can I add $userPromotionDays to $daysToAdd (in Laravel/Carbon)? Answer You can create date with custom format and then add days to it using carbon. You can see details documentation here.

PHP is not applying Regex to check void string

I made a regex Debuggex Demo which allows: NP123 FS-123 FS-123-456 or void works well on Debuggex, but and I don’t understand why PHP accept strings like “TEST” which is not part of the accepted templates Check the fiddler: https://www.phpliveregex.com/p/teA Answer You may use See the regex …