Code from PHP to Elixir

Thanks everybody, I’ve resolve the problem with the answer of @lud