input: Write a function to parse a given json-formatted string into a dictionary. If the input string is empty or not a valid json format, return None. If the dictionary is successfully created, return the dictionary.
  assert parse_json_to_dict('{"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}')=={"name": "John", "age": 30, "address": {"city": "New York", "state": "NY"}}
  assert parse_json_to_dict('')==None
  assert parse_json_to_dict('invalid json')==None
  assert parse_json_to_dict('[]')==None
  assert parse_json_to_dict('{"key": "value"}')=={"key": "value"}
output: import json
  
  def parse_json_to_dict(json_str):
      if not json_str:
          return None
      try:
          return json.loads(json_str)
      except json.JSONDecodeError:
          return None