First of all there are different levels of AI.
Two main categories are Weak AI and Strong AI.
Weak AI can be anything from a chatbot like Alice to something like an opponent in a chess game or a racing game.
Its not the type of intelligence that we humans poses. It is simply a choice tree of what to do in what circumstance and so on.
Systems with weak AI appear to be intelligent, but they are not in relation to human type of intelligence. They obviously do not have self-awareness or consciousness.
And thats what makes Strong AI special. Strong AI is the human-like intelligence. Not just a script that checks inputs with the db of choices but a system that understands that it is a system and that it can reason and think
Unfortunately, or maybe fortunately, we as human race have not been able to create a fully functional Strong AI system with real human-like intelligence.
There are intermediate categories too... read a book on AI if interested.
Now obviously to code Weak AI and Strong AI you would need completely different tools and technologies, as well as different programming techniques and maybe even different methodologies.
For example to write a game opponent AI you can do it in ANY language. Be it PHP or C++. As long as the language has control statements and loops you are good to go. For example "If player is getting closer accelerate and move away from the player". This kind of stuff. Of course it gets complex for a good weak AI system.
For harder weak AI problems people use languages like Prolog and Lisp which I know nothing about.
Now for Strong AI I have no idea
You would have to do more research.
To practice writing AI just make some simple game... like tic tac toe with options "easy, medium, hard, unbeatable".
Then move to a checkers game. Then to chess. Or maybe poker. Yeah poker AI opponent would be nice to program
You get the idea.