if you want a quick fix go buy "learn PHP in ten
minutes" and spend the next twenty years googling for
"how do I compute the length of a string"
If ALL applications in the world were interfaced by
(say) sockets + lisp S expressions and had the
semantics of the protocol written down in a formal
notation - then we could reuse things (more) easily.
If you didn't study CS and want to improve your knowledge of algorithms, I found Coursera classes to be very good.