View Single Post
  #4 (permalink)  
Old 07-24-2008, 08:22 PM
curtiss's Avatar
curtiss curtiss is offline
Moderator
 
Join Date: May 2003
Posts: 1,468
I hope I'm understanding this correctly. I'm assuming that you are saying that you want to store the entire "if" statement you mentioned in your second code block into a string variable. Is that correct?

If so, here is all you need to do:
PHP Code:
function recValues(){
    
$contents_of_page file_get_contents('../bible1.html');
    
preg_match_all("#<td.*>(.+)</td#Ui"$contents_of_page$tdInnerHTML);
    
$totaltds count($tdInnerHTML[1]);
    
$line 0;
    
$strLine = array();
    for(
$k=0$k $totaltds$k++){
        if(
$k 10 == 0){
            print(
"line ");
            
$strLine[$line] = '
        if($k % 10 != 0){
            $j = 0;
            $tdValues = array();
            $tdValues[$j] = $tdInnerHTML[1][$k];
            print("\'");
            print("<span style=\'font-weight: bold; color: red\'>".$tdValues[$j]."</span>");
            //print($tdInnerHTML[1][$k]);
            if($k % 10 == 9){
                print("\'<br />\n");
            }else{
                print("\', ");
            }'
;
            }
            
//return $tdValues[$j];
            
$j++;
            
$line++;
        }
    } 
__________________
I hate Internet Explorer! Anyone with me?

Last edited by curtiss; 07-24-2008 at 08:26 PM.
Reply With Quote