Play Phoenix Wright in order. It's better that way because you actually know the characters and Apollo Justice spoils some parts of the game in it. Then if you like them move on to Ace Attorney investigations.
Summing everything up, here is the order they came out in (not sure about AAI though) and how I recommend you play it.
Phoenix Wright: Ace Attorney
Phoenix Wright: Justice For All
Phoenix Wright: Trials and Tribulations (Last case is the best in the entire series imo)
Apollo Justice: Ace Attorney
Ace Attorney Investigations: Miles Edgeworth
Ace Attorney Investigations: Miles Edgeworth (I don't think it's coming out anywhere outside of Japan though.....)
As for what Phoenix Wright is, it is a court game BUT it gets you to o around and investigate then present everything in court while impressing the (very stupid) judge. It is quite funny at times (especially with the more stupid characters/over obsessive characters) but has a good story line to it.
When you play the first case in the first game, it's really easy because it's just letting you get the hang of it, then it gets harder as in a lot harder than Professor Layton when it comes to the last case in each game.
The hardest one I've played would be PW: T&T Case 5. Apparently, even if you have every single answer and everything, it'll still take at least 8-10 HOURS. Yet, the case is so intriguing you don't get bored of it. Let me give you some good news, you just have to present evidence etc. you don't actually have to figure out the rest, your character either A) Bluffs it Hopes for the best (which always happens thanks to his luck) or C) Actually knows what's going on.
So yeah, I'd say Phoenix Wright is close enough to a Detective game.
Oops, I went on a rant there.