User is looking for the right function to retrieve all category_id’s of a specific post within the loop.
He wants to store the id’s in a variable or an array.
Following is the solution of above stated problem.
Solution: We have finally found the function to solve the problem.
foreach((get_the_category()) as $cat)
Its solution is very simple. You have to just use above code in your website and enjoy the results.