According to this law, the net electric flux through any dosed surface is equal to the net charge inside the surface divided by ε0''.
Therefore, ϕ=ε0q
Let −q1 be the charge, due to which flux ϕ1 is entering the surface ∴ϕ=ε0−q1
or −q1=ε0ϕ1
Let +q2 be the charge, due to which flux ϕ2 is leaving, the surface ∴ϕ2=ε0q2
or q2=ε0ϕ2
So, electric charge inside the surface =q2−q1 =ε0ϕ2+ε0ϕ1 =ε0(ϕ2+ϕ1)