title: convert C# AES encryption code to php
body: <p>This is my c# code i have to convert this to php. out put of this code is 
  FblN3XOgPFBhPbALglniBw== so it should be same in php
  I have tried but wired please help</p>
  
  <pre><code>EncryptAes("999002:GuestCSL", "FREO2016"); 
  public static byte[] EncryptAes(string input, string key)
      {
          var keyArray = HashSha256(key);
          var toEncryptArray = Encoding.ASCII.GetBytes(input);
  
          byte[] result;
  
          using (var aes = new AesCryptoServiceProvider
          {
              Key = keyArray,
              Mode = CipherMode.ECB,
              Padding = PaddingMode.PKCS7
          })
          {
            var cTransform = aes.CreateEncryptor();
            result = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
              aes.Clear();
          }
          return result;
      }
  
      static byte[] HashSha256(string phrase)
      {
          var encoder = new UTF8Encoding();
          var sha256Hasher = new SHA256CryptoServiceProvider();
          var hashedDataBytes = sha256Hasher.ComputeHash(encoder.GetBytes(phrase));
          return hashedDataBytes;
      }
  </code></pre>