<?php

  $s = "<div>this is the variable</div>";
  echo preg_replace("/<div>(.*?)<\/div>/", "$1", $s);
?>