I'm not saying it won't work, I'm saying you're doing more work than you need.
There is no reason to convert to a string prior to checking the count. I'm not sure why you are passing a msgArray on top of a selectedMsgArray; if you are updating all do you really need the msgArray? Maybe its for a pagination option so you only update a page at a time (which is fine)?
In any case, keep it as an array until you need to actually use it.
$aToDelete = array();
$sMsg = "No Messages Selected";
if (isset($_POST['selectAll'])) // assuming a checkbox
$aToDelete = $_POST['msgArray'];
$sMsg = 'All Messages Selected';
else if (count($_POST['selectedMsgArray']) > 0) // or use empty
$aToDelete = $_POST['selectedMsgArray'];
$sMsg = 'Some Messages Selected';
// do the query.