include() or exec()
Posted: Fri May 21, 2010 7:59 pm
I just had a thought about the way I'm doing something in my application.
I have an application which generates a PDF using tcpdf. I also use a graphing program to out put an image to a file and then I include that file in the pdf. What I'm ALSO doing that may not be the best way is, I am using an include to run the script that creates the image. Since I'm not actually including anything from the file that contains the graphcode, I only need to execute the code, let it output the graphic and include the graphic.
Should I be using exec() instead and are there any benefits or downsides to doing so? I've only ever used includes and it just never occurred to me to do it another way.
Thanks.
I have an application which generates a PDF using tcpdf. I also use a graphing program to out put an image to a file and then I include that file in the pdf. What I'm ALSO doing that may not be the best way is, I am using an include to run the script that creates the image. Since I'm not actually including anything from the file that contains the graphcode, I only need to execute the code, let it output the graphic and include the graphic.
Should I be using exec() instead and are there any benefits or downsides to doing so? I've only ever used includes and it just never occurred to me to do it another way.
Thanks.