How can I convert a time string like this:
30/7/2010
to a UNIX timestamp?
I tried strtotime() but I get a empty string :(
You're using UK date format.
Quick and dirty method:
$dateValues = explode('/','30/7/2010');
$date = mktime(0,0,0,$dateValues[1],$dateValues[0],$dateValues[2]);
You probably want to use https://www.php.net/manual/en/function.strptime.php (strptime) since your date is in a different format than what PHP might be expecting.
You could also convert it to a format that strtotime() can accept, like Y/M/D:
$tmp = explode($date_str);
$converted = implode("/", $tmp[2], $tmp[1], $tmp[0]);
$timestamp = strtotime($converted);
mktime(0, 0, 0, $tmp[1], $tmp[0], $tmp[2]);
strtotimedoesn't work because (from the doc) "The function expects to be given a string containing a US English date format"