I am trying to make my own mobile website but I don't know how to do it. I know that I could change the css etc. but I don't want to change only the css. I also want to make a hole different site like this example:

(sorry it's dutch)
But on the left side the desktop example (profile picture + message let's say 20kb each (100kb total))
On the right the mobile website without loading the profile pictures total 20kb.

another example:
twitter.com and https://mobile.twitter.com/ the mobile site is very different than the desktop one. ( and loads smaller images than the desktop one, so different script behind it?)

I can't do something like that in css. So how do I make a website that doesn't load content that is useless and takes up alot of kb.

My solution what maybe is the solution:
make site.com/full/profile.php
and site.com/mobile/profile.php

but it has a big down side for (fast) example:
PHP Code:
If pressed on form insert that date into people
PHP Code:
(mobile optimized)
pressed on form insert that date into people
But what if I want to change my table people into human_beings? I need to change it in site.com/full/profile.php and site.com/mobile/profile.php isn't that annoying? Or is this the way big company's does it too?

So how do I make a website with some parts different than desktop one? (not only css also the code behind it!)