Reply To A Tweet using POST statuses/update



sorry I m a newbee here. I have a php script that can track tweet based on one account send back a tweet if a certain keyword is part of the message.
But this script sends a tweet to the original sender and what I would like to do is to REPLY to the original tweet…
So I ve added the in_reply_to_status_id property with the original tweet id but that doesn’t seem to be what is expected…

Here is the code I m using, can you tell me what’s wrong? Thanks !!

  $tweets = json_decode($response);
  $i = 0;
  $txt = '';
  $txtid = '';
  foreach($tweets as $tweet)
    if ($i == 0){
      $cmp = $tweet->text;
        if (strpos($cmp,"showroom") !== false){
          $txt = "@".$tweet->user->screen_name." You can find all our showroom here:";
          $txtid = '$tweet->id';
  if ($txt != '') {
    $url = "";
    $requestMethod = 'POST';
    $postfields = array(
      'status' => $txt,
      'in_reply_to_status_id' => $txtid

    $twitter = new TwitterAPIExchange($settings);
    $response = $twitter->buildOauth($url, $requestMethod)