开发者

Grab htmls results from a php statement?

开发者 https://www.devze.com 2023-04-13 09:11 出处:网络
I was wonder if there was a way to take the html results that was created from a php script and take that html code generated and put it inside another php script?

I was wonder if there was a way to take the html results that was created from a php script and take that html code generated and put it inside another php script?

The problem I'm having is that I'm working inside a huge php script and I al开发者_C百科ways have errors when I'm working inside it. I want to make additions to the code, but it never works. Files aren't opening. However, when I work outside it and within the same folder, my code works.

So I'm thinking if there's an "Iframe" for php code or maybe I should use an iframe instead?


Can't you just use include or require to include the code from the other script?

  1. Create a function myFunction to output whatever html you want.
  2. Put that code in a file whatever.php
  3. Call include('whatever.php') from your other PHP file
  4. Call myFunction() and your html will be outputted.
0

精彩评论

暂无评论...
验证码 换一张
取 消