> echo sentence_case($row['quote']); ?>} ?>
echo $row['name']; ?>, echo $row['vocation']; ?>, echo $row['location']; ?>
session_start(); require($_SERVER['DOCUMENT_ROOT']."/assets/inc/conn.inc.php"); require($_SERVER['DOCUMENT_ROOT']."/assets/inc/pagination.inc.php"); function extract_common_words($string, $stop_words, $max_count = 40) { $string = preg_replace('/ss+/i', '', $string); $string = trim($string); // trim the string $string = preg_replace('/[^a-zA-Z -]/', '', $string); // only take alphabet characters, but keep the spaces and dashes too… $string = strtolower($string); // make it lowercase preg_match_all('/\b.*?\b/i', $string, $match_words); $match_words = $match_words[0]; foreach ( $match_words as $key => $item ) { if ( $item == '' || in_array(strtolower($item), $stop_words) || strlen($item) <= 3 ) { unset($match_words[$key]); } } $word_count = str_word_count( implode(" ", $match_words) , 1); $frequency = array_count_values($word_count); arsort($frequency); //arsort($word_count_arr); $keywords = array_slice($frequency, 0, $max_count); return $keywords; } function sentence_case($string) { $sentences = preg_split('/([.?!]+)/', $string, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE); $new_string = ''; foreach ($sentences as $key => $sentence) { $new_string .= ($key & 1) == 0? ucfirst(strtolower(trim($sentence))) : $sentence.' '; } return trim($new_string); } if(isset($_GET['keyword'])) { $qext=" AND quote LIKE '%".$_GET['keyword']."%'"; } else { $qext=""; } if(isset($_GET['position'])) { if($_GET['position']=="teacher") { $qext.=" AND (vocation LIKE '%".$_GET['position']."%' OR vocation LIKE '%tutor%')"; } else { $qext.=" AND vocation LIKE '%".$_GET['position']."%'"; } } $num_rows = $mysqliextras->query("SELECT COUNT(*) FROM feedback WHERE reviewed=1".$qext.""); $num_rows = $num_rows->fetch_array(); $num_rows = $num_rows[0]; $allrows = $mysqliextras->query("SELECT COUNT(*) FROM feedback WHERE reviewed=1"); $allrows = $allrows->fetch_array(); $allrows = $allrows[0]; $pages = new Paginator($num_rows,9,array(10,20,50,100,250,'All')); //echo $pages->display_pages(); $start=$pages->limit_start; $end=$pages->limit_end; $quotes = $mysqliextras->query("SELECT quote FROM feedback WHERE reviewed=1".$qext.""); $allquotes=""; while($rows=$quotes->fetch_assoc()) { $allquotes.=$rows['quote']." "; } $res = $mysqliextras->query("SELECT * FROM feedback WHERE reviewed=1".$qext." ORDER BY added DESC LIMIT ".$start.",".$end."") or die('Db error'); $displaynum=(mysqli_num_rows($res)/2)+1; /*echo "
Page: $pages->current_page of $pages->num_pages
\n";*/ ?> include($_SERVER['DOCUMENT_ROOT'].'/assets/inc/header.php'); ?> if($_SESSION["section"]=="student") { include($_SERVER['DOCUMENT_ROOT'].'/assets/inc/navbar-learner.php'); } elseif($_SESSION["section"]=="teacher") { include($_SERVER['DOCUMENT_ROOT'].'/assets/inc/navbar-teacher.php'); } elseif($_SESSION["section"]=="parent") { include($_SERVER['DOCUMENT_ROOT'].'/assets/inc/navbar-parent.php'); } else { include($_SERVER['DOCUMENT_ROOT'].'/assets/inc/navbar.php'); } ?> It really helps me catch up at school and I feel more confident than before!
Mic, Student, Warwick
Read more...
> echo sentence_case($row['quote']); ?>} ?>
echo $row['name']; ?>, echo $row['vocation']; ?>, echo $row['location']; ?>