Getting arguments from URL in drupal 8 like arg() in drupal 7

Arg function is deprecated in drupal 8 so you need to call the drupal request class to get the passed parameters

$path = \Drupal::request()->getpathInfo();

$arg = explode('/',$path);