Inclusive φ production in K−p and π+p interactions and comparison with J/ψ production