Charged particles ( $h^\pm$ ) and $K^0$ mesons have been studied in photoproduced events containing at least one jet of $E_T > 8$ GeV in a pseudorapidity interval (–0.5, 0.5) in the ZEUS laboratory frame. Distributions are presented in terms of transverse momentum, pseudorapidity and distance of the particle from the axis of a jet. The properties of $h^\pm$ within the jet are described well using the standard settings of PYTHIA, but the use of the multiparton interaction option improves the description outside the jets. A reasonable overall description of the $K^0$ behaviour is possible with PYTHIA using a reduced value of the strangeness suppression parameter. The numbers of $h^\pm$ and $K^0$ within a jet as defined above are measured to be $3.25\pm0.02\pm0.28$ and $0.431\pm0.013\pm0.088$ respectively. Fragmentation functions are presented for $h^\pm$ and $K^0$ in photoproduced jets; agreement is found with calculations of Binnewies et al. and, at higher momenta, with $p\bar p$ scattering and with standard PYTHIA. Fragmentation functions in direct photoproduced events are extracted, and at higher momenta give good agreement with data from related processes in $e^+e^-$ annihilation and deep inelastic $ep$ scattering.