Is it as simple as calling
memory_get_usage() at the start and end of a script and subtracting the 1st from the second value, to get the total memory used on that script? If so, how can I convert that value to a more understandable number like kb and mb?
You mean something like this?
I normally use this to format file sizes, but you can use it to solve your problem.
You may prefer to just call memory_get_peak_usage at the end of your script, which will return the highest total allocation during execution. This is more likely to be a useful figure - getting the start and end values doesn't account for memory allocated then deallocated during runtime.
Formatting this into a human readable number can be handled manually (just divide by 1024 then print as Kb), or with a class like NumberFormatter.