i want to ask.

i grab data time from html, and i try to insert to my db.
when insert the format like "**Â Â 8:16:25 PM 8/8/2017Â Â**".
how i convert to timestamp format, because i want to range it.
i try to cut the string and make it utf8\_decode or utf8\_encode before insert. but when range i can't get the time. sorry for my english.

CODE :

```
$first = array('PM','/','AM');
$first2 = array('','-','');
$strreplacebegdate = str_replace($first,$first2, $tujuh);
$substrreplacebegdate1 = substr($strreplacebegdate,14,9);
$re = array(' ','?');
$re2 = array('','');
$strreplacebegdatelagi = str_replace($re,$re2, $substrreplacebegdate1);
$substrreplacebegdate2 = substr($strreplacebegdate,6,7);
$consubstringbegdate = $substrreplacebegdate1." ".$substrreplacebegdate2;
$timeenddate = strtotime($strreplacebegdatelagi);
$newformatbegdate = date('Y-m-d',$timeenddate);

```

output : 0000-00-00 00:00:00