First make sure you have received captcha in the background, Then make sure there is no captcha in the session. Then check the official manual. Generate---save session---receive---verify
reply
0
But you can use captcha_check() to verify whether it is correct.