I'm trying to take a value from some variable which looks like this:
$ a= '[custom:data-rekrutacji]';
using [custom:data-rekrutacji] token which I've already defined which should contain the value: 2015-08-11 13:00:00, but if I check it using var_dump()
as below:
var_dump($a);
I'm getting something like this:
string(24) "
2015-08-11 13:00:00
"
However I would like to have only this (as below) so I can use function strtotime($a)
:
2015-08-11 13:00:00
Is it possible to trim this?
I've tried in this way, but without success:
$a= '[custom:data-rekrutacji]';
trim($a);
echo strtotime($a);
Have you tried saving the change:
$a = trim($a);
EDIT:
If your variable has the correct values it should output correctly.
Code between the [ ] shows it was trimmed correctly, the next one should return the time in an int.
This is the result I get: