preg match - Getting Value from javascript using php preg_match -
preg match - Getting Value from javascript using php preg_match -
i trying value javascript php preg_match, not quite sure how can .
i want "/cusa/includefile.action?productoverviewcid=0901e024801e6aba&componentcid=0901e024800bef11&userselectedmodel=0901e024801e6aba" come between "tabspecifications" , , "specifications"
here trying do, not working.
$file = ' <script type="text/javascript"> tabcls.push( new pagemodeltab( "tabspecifications" , "/cusa/includefile.action?productoverviewcid=0901e024801e6aba&componentcid=0901e024800bef11&userselectedmodel=0901e024801e6aba" , "specifications" , 3 , false , "" , null , true , null ) ); function onclick_tabspecifications() { seek { var location = new string(window.location); if (location && location.indexof("?selectedname") != -1) { homecoming true; } new tabstate("3").addtabtobrowserhistory(); show("3"); showhidefooterdisclaimer(\'specifications\'); homecoming false; } grab (e) { //alert(e.message); homecoming true; } } </script>'; preg_match("/^cusa/", $file ); i start basics of preg_match ...
please help
this worked me -
$pattern = '/(\/cusa\/).*/'; preg_match($pattern, $file, $match); print_r($match); example
if want add together search parameters (as asked in comment) -
$pattern = '/(\/cusa\/includefile.action).*/'; php preg-match
Comments
Post a Comment