PHP pros, please give me your advice

I've somewhat inadvertently inherited the backend of a website that I like quite a lot. It's written in PHP, and the code is rather messy.

I'm not very experienced, so I'm trying to figure out how to go about this and avoid fucking up. I've been looking up best practices and such, my main sources of confusion right now are how to organize the layout of the project and minimize redundancy. Would this be a good case for a PHP framework? I'm looking for a solution that will:

rewrite it in rust

Stop using PHP.

which site?

cia nigger

rewrite it in haskell

well i'm open to suggestions, but i'd rather not have to rewrite their whole backend

it's a website dedicated to a very specific type of weeaboo music that I like

rewrite it in Go

Write it in C

...

?
I was thinking that having a base that functions, something to improve over time, would be ideal. If I had to rewrite the scratch, it'd be reinventing the wheel (i'd be doing this anyway I guess, but not all at once).

Are yiu running the site?
Are you just a dev? Are you the lead dev?
Is it working? Does it need change? Is it secure? Is it performant? Do you want/need to add features?
How big is the codebase?

Delete the source code.

I'm not running the site, just one (of two) developers trying to work on the backend, but the other guy doesn't seem to have much of a better idea than me.

Yes

Well, it functions, but it's very messy, hard to work with.

As far as I can tell

Yes

post url + source pls. i will consider rewriting it in rust.

Why Rust when GoLang is a thing?

>lol no generics
i'll stick with rust thank you

It is 2017, bro. You need to embrace modern development practices and rewrite your webapp in JavaScript. If you rewrite your frontend in React and rewrite backend as cluster of microserveces that use NodeJS and MongoDB all your problems will dissapear.

Ever post so far is shitposters. ....

my post is not a shitpost

Break up whatever code there is into sensibly defined functions. Chances are that if the code is really shit, the average function length is absolutely retarded. Aim for a max of 20 lines per function.

Once you've done that, you can refactor the code however the fuck you want.

lol


post the fucking source you nerd

Why Go when NodeJS is a thing?

kill yourself

no u

Use laravel

Use Java

ALGOL
L
G
O
L

I'm sorry for shitposting in your thread, i'm hoping that shitposting aside, the bumping will help bring attention to this thread.

Rewrite it in Ada. Ada is robust and military grade in preventing the code from becoming a mess.

why dont you nigger post the source?

So, a pretty standard php site.

Anyway, you're giving way too little information to give any useful advice.

I'd say continue with it like it is, for now.

meanwhile rewrite it in lolcode

m8, how are we supposed to know if a certain framework won't break existing functionality when you don't tell us anything about said existing functionality?
post the source code or tell us which site it is so people can have a look and see what kind of shit is already done so they can actually give you some proper feedback

I think you mean the backend should be a cluster of microfeces

seconded