Utility function to check whether number is semiprime or not
< ? php function checkSemiprime ( $ num ) { $ cnt = 0 ; for ( $ i = 2 ; $ cnt < 2 && $ i * $ i <= $ num ; ++ $ i ) while ( $ num % $ i == 0 ) $ num /= $ i ; ++ $ cnt ;