invatphp Posted July 15, 2012 Report Share Posted July 15, 2012 $curl = file_get_contents( "http://la-psiholog.ro/teste-psihologice/afla-ce-cred-ceilalti-despre-tine" ) ;preg_match_all( '#<div\sclass=\"test-qnr\"\s>(?P<digit>\d+)<\/div>.+?<div\sclass=\"test-q\">(?P<Question>.+?)<\/div>.+?onclick=\"clk(([^\"]*))\".+?<div\sclass=\"test-atxt\">(?P<Answer>.+?)<\/div>#sim',$curl, $test ) ;print_r( $test[1] ) ; // Numarul intrebariiecho "<br/>" ;echo "<br/>" ;print_r( $test['Question'] ) ; // Intrebareaecho "<br/>" ;echo "<br/>" ;print_r( $test[3] ) ; // Numarul optiunii de raspuns din intrebareecho "<br/>" ;echo "<br/>" ;print_r( $test['Answer'] ) ; // Raspunsul din intrebareEroarea pe care o intampin este ca pentru fiecare intrebare in parte ar trebuii sa-mi afiseze numerele si raspunsurile atatea cate sunt, numai ca mie imi afiseaza doar primele linii de optiune si raspuns de la fiecare intrebare. Unde am gresit in cod si cine ma poate ajuta cu solutie? Quote Link to comment Share on other sites More sharing options...