in reply to Re: how to retrieve data between <script></script> and save to an array
in thread how to retrieve data between <script></script> and save to an array

Hello CountZero, your code works very well ! Thanks ! However, if the long string contains the following html page in which I want to retrieve content between <script> and </script>, how to do that by using your way ? Thanks,

<html> <head> <script language="javascript" src="" id="scptMDtl"></script> <script language="javascript">var onWL=0;var oJS = new Object();</scri +pt> <script language="javascript"> var a_fInDelItms = 0; var a_fPrv = 1; var a_fTxt = 0; </script> </head> <body> <textarea id="txtBdy" class="w100 txtBdy" style="display:none"> This is a test. </textarea> <script language="javascript"> var a_sId = "RgAAAADz6rvTg9+xRIGTnTWlmKbHBwCeJ0LFThYQQaU\/Nvmo +3DG+AAACNa1IAABO5K\/6RD2SRbSFY4IMoQCbAAAAFHnvAAAJ"; var a_sCK = "TuSv+kQ9kkW0hWOCDKEAmwAAABXdNQ=="; </script> </body> </html>
  • Comment on Re^2: how to retrieve data between <script></script> and save to an array
  • Download Code

Replies are listed 'Best First'.
Re^3: how to retrieve data between <script></script> and save to an array
by CountZero (Bishop) on Apr 11, 2012 at 05:59 UTC
    Just put that long string in $text and feed it to $t->parse("$text");

    It works as advertised!

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics