Calculate the size of data being received in PHP /Javascript -


Using Ajax request, I get the content that is displayed on the web page.

The content can only contain string / string + html content / string + image.

I need to calculate the total size of the content and if it is more than 200 KB, I do not want to show it on the HTML page.

How do I calculate the size of any content in jQuery / Angualarjs / Javascript / PHP?

Modify your PHP backend:

  ob_start (); // All content generated here ... $ output = ob_get_clean (); If (strollon ($ output) & gt; (200 * 1024)) {// return error front end} other {$ echo output}}  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -