How to view page source in Safari browser on an iPhone?
Apple’s native solution is Safari Web Inspector. Currently all developer tools for iOS do still run on macOS so get out your mac and dive in if you want a first party solution.
Here’s a 5 minute tech talk, but the developer site has hours and pages of content depending on what you are going to do with this.

https://developer.apple.com/videos/play/tech-talks/401/

To enable on the iPhone - use the setting app, Safari, Advanced