Search Results

Search found 410 results on 17 pages for 'explode'.

Page 9/17 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • problem in decreasing page's queries

    - by Mac Taylor
    hey guys i have a tag table in my php/mysql project that looks like this Table name : bt_tags Table fileds : tid,tag and for every story rows there is a filed named : tags Table name: stories table filed : tags that saved in this field as ids 1 5 6 space between them now problem : when using while loop to fetch all fields in story table , the page uses 1 query to show every stories' detail but for showing tag's names , i should query another table to find names , we have ids stored in story table now i used for loop between while loop to show tag names but im sure there is a better way to decrease page queries how can i improve this script and show tag's names without using *for loop ?* $result = $db->sql_query("SELECT * FROM ".STORY_TABLE." "); while ($row = $db->sql_fetchrow($result)) { //fetching other $vars ---- $tags_id = explode(" ",$row['tags']); $c = count($tags_id); for($i=1;$i<$c-1;$i++){ list($tag_name,$slug) = $db->sql_fetchrow($db->sql_query( 'SELECT `tag`,`slug` FROM `bt_tags` WHERE `tid` = "'.tags_id[$i].'" LIMIT 1' )); $sow_tags = '$tag_name,'; }

    Read the article

  • removing dashboard menu options for the user role editor

    - by styler
    I want to remove some of the dashboard menu tabs on my wordpress site using this code: //Remove some menu options function remove_menus () { global $menu; $restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Contact'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins')); end ($menu); while (prev($menu)){ $value = explode(' ',$menu[key($menu)][0]); if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);} } } add_action('admin_menu', 'remove_menus'); At the moment this removes the menus from all user roles, how could I update this to just apply to editors? Ive also got this snippet of code but dont know how to combine it with what I have: $editor = get_role(‘editor’); $editor->remove_cap(‘publish_pages’);

    Read the article

  • Calculating percentiles in Excel with "buckets" data instead of the data list itself

    - by G B
    I have a bunch of data in Excel that I need to get certain percentile information from. The problem is that instead of having the data set made up of each value, I instead have info on the number of or "bucket" data. For example, imagine that my actual data set looks like this: 1,1,2,2,2,2,3,3,4,4,4 The data set that I have is this: Value No. of occurrences 1 2 2 4 3 2 4 3 Is there an easy way for me to calculate percentile information (as well as the median) without having to explode the summary data out to full data set? (Once I did that, I know that I could just use the Percentile(A1:A5, p) function) This is important because my data set is very large. If I exploded the data out, I would have hundreds of thousands of rows and I would have to do it for a couple of hundred data sets. Help!

    Read the article

  • paging php error - undefined index

    - by fusion
    i've a search form with paging. when the user enters the keyword initially, it works fine and displays the required output; however, it also shows this error: Notice: Undefined index: page in C:\Users\user\Documents\Projects\Pro\search.php on line 21 Call Stack: 0.0011 372344 1. {main}() C:\Users\user\Documents\Projects\Pro\search.php:0 . .and if the user clicks on the 'next' page, it shows no output with this error thrown: Notice: Undefined index: q in C:\Users\user\Documents\Projects\Pro\search.php on line 19 Call Stack: 0.0016 372048 1. {main}() C:\Users\user\Documents\Projects\Pro\search.php:0 this is my code: <?php ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); include 'config.php'; $search_result = ""; $search_result = trim($_GET["q"]); $page= $_GET["page"]; //Get the page number to show if($page == "") $page=1; $search_result = mysql_real_escape_string($search_result); //Check if the string is empty if ($search_result == "") { echo "<p class='error'>Search Error. Please Enter Your Search Query.</p>" ; exit(); } if ($search_result == "%" || $search_result == "_" || $search_result == "+" ) { echo "<p class='error1'>Search Error. Please Enter a Valid Search Query.</p>" ; exit(); } if(!empty($search_result)) { // the table to search $table = "thquotes"; // explode search words into an array $arraySearch = explode(" ", $search_result); // table fields to search $arrayFields = array(0 => "cQuotes"); $countSearch = count($arraySearch); $a = 0; $b = 0; $query = "SELECT cQuotes, vAuthor, cArabic, vReference FROM ".$table." WHERE ("; $countFields = count($arrayFields); while ($a < $countFields) { while ($b < $countSearch) { $query = $query."$arrayFields[$a] LIKE '%$arraySearch[$b]%'"; $b++; if ($b < $countSearch) { $query = $query." AND "; } } $b = 0; $a++; if ($a < $countFields) { $query = $query.") OR ("; } } $query = $query.")"; $result = mysql_query($query, $conn) or die ('Error: '.mysql_error()); $totalrows = mysql_num_rows($result); if($totalrows < 1) { echo '<span class="error2">No matches found for "'.$search_result.'"</span>'; } else { $limit = 3; //Number of results per page $numpages=ceil($totalrows/$limit); $query = $query." ORDER BY idQuotes LIMIT " . ($page-1)*$limit . ",$limit"; $result = mysql_query($query, $conn) or die('Error:' .mysql_error()); ?> <div class="caption">Search Results</div> <div class="center_div"> <table> <?php while ($row= mysql_fetch_array($result, MYSQL_ASSOC)) { $cQuote = highlightWords(htmlspecialchars($row['cQuotes']), $search_result); ?> <tr> <td style="text-align:right; font-size:15px;"><?php h($row['cArabic']); ?></td> <td style="font-size:16px;"><?php echo $cQuote; ?></td> <td style="font-size:12px;"><?php h($row['vAuthor']); ?></td> <td style="font-size:12px; font-style:italic; text-align:right;"><?php h($row['vReference']); ?></td> </tr> <?php } ?> </table> </div> <?php //Create and print the Navigation bar $nav=""; if($page > 1) { $nav .= "<a href=\"search.php?page=" . ($page-1) . "&string=" .urlencode($search_result) . "\"><< Prev</a>"; } for($i = 1 ; $i <= $numpages ; $i++) { if($i == $page) { $nav .= "<B>$i</B>"; }else{ $nav .= "<a href=\"search.php?page=" . $i . "&string=" .urlencode($search_result) . "\">$i</a>"; } } if($page < $numpages) { $nav .= "<a href=\"search.php?page=" . ($page+1) . "&searchstring=" .urlencode($search_result) . "\">Next >></a>"; } echo "<br /><br />" . $nav; } } else { exit(); } ?>

    Read the article

  • pagination in php error

    - by fusion
    i've implemented this pagination class for my webpage in a separate file called class.pagination.php, but when i execute the page, nothing happens. it just displays a blank page. this is my search.php file, where i'm calling this class: <?php include 'config.php'; require ('class.pagination.php'); $search_result = ""; $search_result = $_GET["q"]; $search_result = trim($search_result); //Check if the string is empty if ($search_result == "") { echo "<p class='error'>Search Error. Please Enter Your Search Query.</p>" ; exit(); } //search query for multiple keywords if(!empty($search_result)) { // the table to search $table = "thquotes"; // explode search words into an array $arraySearch = explode(" ", $search_result); // table fields to search $arrayFields = array(0 => "cQuotes"); $countSearch = count($arraySearch); $a = 0; $b = 0; $query = "SELECT cQuotes, vAuthor, cArabic, vReference FROM ".$table." WHERE ("; $countFields = count($arrayFields); while ($a < $countFields) { while ($b < $countSearch) { $query = $query."$arrayFields[$a] LIKE '%$arraySearch[$b]%'"; $b++; if ($b < $countSearch) { $query = $query." AND "; } } $b = 0; $a++; if ($a < $countFields) { $query = $query.") OR ("; } } $query = $query.")"; $result = mysql_query($query, $conn) or die ('Error: '.mysql_error()); $totalrows = mysql_num_rows($result); if($totalrows < 1) { echo '<span class="error2">No matches found for "'.$search_result.'"</span>'; } else { ?> <div class="caption">Search Results</div> <div class="center_div"> <table> <?php while ($row= mysql_fetch_array($result, MYSQL_ASSOC)) { $cQuote = highlightWords(htmlspecialchars($row['cQuotes']), $search_result); ?> <tr> <td style="text-align:right; font-size:15px;"><?php h($row['cArabic']); ?></td> <td style="font-size:16px;"><?php echo $cQuote; ?></td> <td style="font-size:12px;"><?php h($row['vAuthor']); ?></td> <td style="font-size:12px; font-style:italic; text-align:right;"><?php h($row['vReference']); ?></td> </tr> <?php } ?> </table> </div> <?php } } else { exit(); } //Setting Pagination $pagination = new pagination(); $pagination->byPage = 5; $pagination->rows = $totalrows; // number of records in a table-back mysql_num_rows () instance or another, you have to play $from = $pagination->fromPagination(); // sql used for applications such LIMIT $ from, $ pagination-> byPage $pages = $pagination->pages(); if(isset($pages)) {?> <div class="pagination"> <?foreach ($pages as $key){?> <?if($key['current'] == 1) {?> <a href="?p=<?=$key['p']?>" class="active"><?=$key['page']?></a> <?} else {?> <a href="?p=<?=$key['p']?>" class="inactive"><?=$key['page']?></a> <?}?> <?}?> </div> <?} //End Pagination ?>

    Read the article

  • How to get regex split from other var

    - by Dean
    Hi, $dbLink = mysql_connect('localhost', 'root', 't'); mysql_select_db('pc_spec', $dbLink); $html = file_get_contents('http://localhost/pc_spec/scrape.php?q=amd+955'); echo $html; $html = strip_tags($html); $price = ereg("\$.{6}", $html); $html = mysql_real_escape_string($html); $price = mysql_real_escape_string($price); $insert = mysql_query("INSERT INTO parts(part, price) values('$html','$price')") or var_dump(mysql_error()); How can I get $price to match $.{6} and insert this value (eg. $111.11) into a database and remove it from $html? Do I need to use explode? Thanks

    Read the article

  • JBoss, exploded jar vs compact jar.

    - by Win Man
    Hi, I am working on Java 1.6, JBoss 5.1, EJB 3, and Hibernate 2. Every time I deploy the ear, if the jar is a compact one (non-exploded), application doesn't work. However when I explode the jar and then add it to the ear, the app works fine. Tried restarting Jboss, doesn't help. The ear refers to numerous external jars; would the order of loading the jars be an issue? How can I make JBoss load external jars followed by the app jars? Thx. WM.

    Read the article

  • How to separate database entries and display them as individual records using PHP?

    - by Clark
    I used to have database entries separated by ampersands (&), but this was causing certain search issues so I decided to encapsulate my entries on both sides by $ and & symbols like: $this& But I am having trouble displaying all the entries of a cell as individual records. Before I used: $unsplitItems = $row['files']; $files = explode("@", $unsplitItems); foreach ($files as $file) { if(strlen($file)) { echo "<li>$file</li>"; } } Any idea how I can split my records and display all the items in the array as individual entries?

    Read the article

  • Yet Another Simple Retain Count Question

    - by yar
    [I'm sure this is not odd at all, but I need just a bit of help] I have two retain properties @property (nonatomic, retain) NSArray *listContent; @property (nonatomic, retain) NSArray *filteredListContent; and in the viewDidLoad method I set the second equal to the first self.filteredListContent = self.listContent; and then on every search I do this self.filteredListContent = [listContent filteredArrayUsingPredicate:predicate]; I thought I should do a release right above this assignment -- since the property should cause an extra retain, right? -- but that causes the program to explode the second time I run the search method. The retain counts (without the extra release) are 2 the first time I come into the search method, and 1 each subsequent time (which is what I expected). Some guidance would help, thanks! Is it correct to not release?

    Read the article

  • php array into mysql

    - by mckenzie
    Hello, $sql_where = ''; $exclude = '30,35,36,122,123,124,125'; if($exclude != '') { $exclude_forums = explode(',', $exclude); foreach ($exclude_forums as $id) { if ($id > 0) { $sql_where = ' AND forum_id <> ' . trim($id); } } } $sql = 'SELECT topic_title, forum_id, topic_id, topic_type, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_time FROM ' . TOPICS_TABLE . ' WHERE topic_status <> 2 AND topic_approved = 1 ' . $sql_where . ' ORDER BY topic_time DESC'; The above code i use to exclude the id of forum to be displayed on sql queries. Why doesn't it work and still display it? Any solution

    Read the article

  • Which of the two ways should I use to insert tags into mysql?

    - by ggfan
    For each ad, I allow users to choose up to 5 tags. Right now, in my database, I have it like... Posting_id TagID 5 1 5 2 5 3 6 5 6 1 But i was thinking if I should make it like... Posting_id TagID 5 1 2 3 6 5 1 Then first option is much easier to insert and retrieve data. But if I have 100 posts with 3 tags each, that's 300 rows...so ALOT more rows The second option requires using explode() impode(), etc but it is much cleaner. Which option should I do and why? thanks!

    Read the article

  • PHP Check if <ul> has ended IF it exists

    - by Krewe
    I have my blog generate a preview by taking the first 300 characters and cut off the last whole word. My problem is, when I have a list near the top of the blog it is sometimes included in the preview, however the end list tag usually never is. So how can I check the $preview variable for a starting list tag, and if it is found, check for an ending tag and if it's not there add one. All the code for my preview. $preview = wordwrap($content, 300); $preview = explode("\n", $preview); $preview = $preview[0] . "...";

    Read the article

  • PHP split string into integer element and string

    - by David19801
    Hello, I have a string say: Order_num = "0982asdlkj" How can I split that into the 2 variables, with the number element and then another variable with the letter element in php? The number element can be any length from 1 to 4 say and the letter element fills the rest to make every order_num 10 characters long in total. I have found the php explode function...but don't know how to make it in my case because the number of numbers is between 1 and 4 and the letters are random after that, so no way to split at a particular letter. Please help as specifically as possible!

    Read the article

  • Check if key exists in $_SESSION by building index string

    - by Kim
    I need to check if a key exists and return its value if it does. Key can be an array with subkeys or endkey with a value. $_SESSION['mainKey']['testkey'] = 'value'; var_dump(doesKeyExist('testkey')); function doesKeyExist($where) { $parts = explode('/',$where); $str = ''; for($i = 0,$len = count($parts);$i<$len;$i++) { $str .= '[\''. $parts[$i] .'\']'; } $keycheck = '$_SESSION[\'mainKey\']' . $str; if (isset(${$keycheck})) { return ${$keycheck}; } // isset($keycheck) = true, as its non-empty. actual content is not checked // isset(${$keycheck}) = false, but should be true. ${$var} forces a evaluate content // isset($_SESSION['mainKey']['testkey']) = true } What am I doing wrong ? Using PHP 5.3.3.

    Read the article

  • How can I use an array within a SQL query

    - by ThinkingInBits
    So I'm trying to take a search string (could be any number of words) and turn each value into a list to use in the following IN statement) in addition, I need a count of all these values to use with my having count filter $search_array = explode(" ",$this->search_string); $tag_count = count($search_array); $db = Connect::connect(); $query = "select p.id from photographs p left join photograph_tags c on p.id = c.photograph_id and c.value IN ($search_array) group by p.id having count(c.value) >= $tag_count"; This currently returns no results, any ideas?

    Read the article

  • Exploding a range of dates with LINQ

    - by Robert Gowland
    If I have a pair of dates, and I want to generate a list of all the dates between them (inclusive), I can do something like: System.DateTime s = new System.DateTime(2010, 06, 05); System.DateTime e = new System.DateTime(2010, 06, 09); var list = Enumerable.Range(0, (e - s).Days) .Select(value => s.AddDays(value)); What I'm stuck on is that I've got a list of pairs of dates that I want to explode into a list of all the dates between them. Example: {2010-05-06, 2010-05-09}, {2010-05-12, 2010-05-15} should result in {2010-05-06, 2010-05-07, 2010-05-08, 2010-05-09, 2010-05-12, 2010-05-13, 2010-05-14, 2010-05-15} Note the pairs of dates are guaranteed not to overlap each other.

    Read the article

  • Simple PHP query question: LIKE

    - by pg
    When I replace $ordering = "apples, bananas, cranberries, grapes"; with $ordering = "apples, bananas, grapes"; I no longer want cranberries to be returned by my query, which I've written out like this: $query = "SELECT * from dbname where FruitName LIKE '$ordering'"; Of Course this doesn't work, because I used LIKE wrong. I've read through various manuals that describe how to use LIKE and it doesn't quite make sense to me. If I change the end of the db to "LIKE "apples"" that works for limiting it to just apples. Do I have to explode the ordering on the ", " or is there a way to do this in the query?

    Read the article

  • How to seperate database entries and display them as individual records using PHP?

    - by Clark
    I used to have database entries separated by ampersands (&), but this was causing certain search issues so I decided to encapsulate my entries on both sides by $ and & symbols like: $this& But I am having trouble displaying all the entries of a cell as indiivdual records. Before I used: $unsplitItems = $row['files']; $files = explode("@", $unsplitItems); foreach ($files as $file) { if(strlen($file)) { echo "<li>$file</li>"; } } Any idea how I can split my records and display all the items in the array as individual entries?

    Read the article

  • Array iteration issue

    - by Tao
    i have this array which i echo and get this results: $hostess_ids[]=$row['hostess_id']; $j=0; foreach($hostess_ids as $hostess_selected){ $hostess_array= explode("-",$hostess_selected); echo var_dump($hostess_array); This is the output array(1) { [0]=> string(2) "16" } array(1) { [0]=> string(2) "16" } array(1) { [0]=> string(0) "" } array(1) { [0]=> string(0) "" } array(2) { [0]=> string(2) "17" [1]=> string(1) "1" } array(1) { [0]=> string(0) "" } array(2) { [0]=> string(2) "17" [1]=> string(1) "1" } array(2) { [0]=> string(2) "17" [1]=> string(2) "16" } How can i iterate in this array to get the first ceel values, then the second one, etc etc... Thanks..

    Read the article

  • How to know if the website being scraped has changed?

    - by Lost_in_code
    I'm using PHP to scrape a website and collect some data. It's all done without using regex. I'm using php's explode() method to find particular HTML tags instead. It is possible that if the structure of the website changes (CSS, HTML), then wrong data may be collected by the scraper. So the question is - how do I know if the HTML structure has changed? How to identify this before storing any data to my database to avoid wrong data being stored.

    Read the article

  • Need help... how to add md5 to password field in php?

    - by jones
    Hi mates, i looking some help and nice attention here.. i bought some php script many years ago and now no suport anymore... i just want to add md5 to password field.. here my form: <?php $SQL = "SELECT * from USERS WHERE USERNAME = '$_SESSION[username]'"; $result = @mysql_query( $SQL ); $row = @mysql_fetch_array( $result ); include 'menu.php'; ?> <FORM METHOD="post" ACTION="?page=query_client"> <INPUT TYPE="hidden" NAME="controller" VALUE="USERS~update~account_details&up=1~<?php echo $row[ID]; ?>"> <TABLE CLASS="basictable"> <TR> <TD CLASS="tdmenu" WIDTH="40%">Username</TD> <TD CLASS="tdmenu" WIDTH="60%"> <b><?php echo $row[USERNAME]; ?></b> </TD> </TR> <TR> <TD CLASS="tdmenu" WIDTH="40%">Password *</TD> <TD CLASS="tdmenu" WIDTH="60%"> <INPUT TYPE="PASSWORD" NAME="PASSWORD" SIZE="40" VALUE="<?php echo $row[PASSWORD]; ?>"> </TD> </TR> <TR> <TD CLASS="tdmenu" WIDTH="40%">Email Address *</TD> <TD CLASS="tdmenu" WIDTH="60%"> <INPUT TYPE="text" NAME="EMAIL" SIZE="40" VALUE="<?php echo $row[EMAIL]; ?>"> </TD> </TR> <TR> <TD CLASS="tdmenu" WIDTH="40%">Full Name *</TD> <TD CLASS="tdmenu" WIDTH="60%"> <INPUT TYPE="text" NAME="FULLNAME" SIZE="40" VALUE="<?php echo $row[FULLNAME]; ?>"> </TD> <TR> <TD CLASS="tdmenu" WIDTH="40%">Address *</TD> <TD CLASS="tdmenu" WIDTH="60%"> <INPUT TYPE="text" NAME="ADDRESS1" SIZE="40" VALUE="<?php echo $row[ADDRESS1]; ?>"> </TD> </TR> <BR> <TABLE CLASS="basictable"> <TR> <TD CLASS="tdhead2" > <DIV ALIGN="CENTER"><B> <INPUT TYPE="submit" NAME="Submit" VALUE="Submit"> </B></DIV> </TD> </TR> </TABLE> </FORM> and the it self as query_client.php inside look like: <?PHP @session_start(); $controller = $_POST['controller']; $pieces = explode("~", $controller); $table = $pieces[0]; $qt = $pieces[1]; $return = $pieces[2]; $id = $pieces[3]; $hack = $pieces[4]; if ($qt == insert) $qt = 'INSERT INTO'; if ($qt == update) { $qt = 'UPDATE'; $end = "WHERE ID = '$id'"; } $pre = array_keys( $_POST ); mysql_query ("CREATE TABLE IF NOT EXISTS `$table` (`ID` INT NOT NULL AUTO_INCREMENT , PRIMARY KEY ( `id` ) )"); $count = count($pre); $count = $count - 2; $sql = "$qt $table SET"; for ($i=0; $i < $count; $i++) { $x=$i+1; $y = $_POST[$pre[$x]]; $d = $y; mysql_query ("ALTER TABLE `$table` ADD `$pre[$x]` TEXT NOT NULL"); $sql .= " `$pre[$x]` = '$d',"; } $sql .= " ID = '$id' $end"; $query = mysql_query($sql) or die("$sql_error" . mysql_error()); if (empty($hack)) { } else { $pieces = explode("/", $hack); $h0 = $pieces[0]; $h1 = $pieces[1]; $h2 = $pieces[2]; $h3 = $pieces[3]; $h4 = $pieces[4]; $h5 = $pieces[5]; mysql_query ("ALTER TABLE `$table` $h0 $h1 $h2 $h3 $h4 $h5"); $query = mysql_query($sql) or die("$sql_error" . mysql_error()); } if (isset($_GET[inc])) include "$_GET[inc].php"; ?> so please help me how to add md5 in PASSWORD field? thanks in advance..

    Read the article

  • PHP, how can I produce a string, a unique list of values up to three items, for use after IN in a query?

    - by Jules
    I need to produce a string for use in an query e.g. SELECT whatever from Keywords.word IN (here); At the moment I have string which could be $search = "one word or four"; or $search = "one"; or $search = "one one"; I need to validate this into some acceptable for my query. I want a unique list of words, separated with a comma up to a maximum of three. This is what I have so far. $array = explode(" ",$search); $unique = array_unique ($array); I'm sure there must be a quicker way than evaluating each of the items for blank and selecting the first three.

    Read the article

  • Where is the rand php function located? localhost php running, path of default functions?

    - by Bona Chon
    I have a local server installed on my Mac (MAMP). My question is, where I can find the php functions in my computer? What is the path to the functions folder? For instance, rand() time() isset() explode(). I would like to se the code to learn of it. I have a while looking for it, but I can't find it. Or is it that is already compiled? Can someone help me here? I'm kind of lost. Thanks people. EDIT: can you be a little bit more positive? I;m trying to learn here, forgive me if I'm not to smart for you. Thanks again. Explanations would help better than giving links I guess?

    Read the article

  • PHP - Search array in array

    - by Anonymous2011
    I have tried googling for the past one hour straight now and tried many ways to search for an array, in an array. My objective is, to find a keyword in the URL, and the keywords are in a txt file. This is what i have so far - but doesn't work. $file = "keywords.txt"; $open = fopen($file,'r'); $data = fread($open,filesize($file)); $data = explode(" ",$data); $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $url = parse_url($url); //parse the URL into an array foreach($data as $d) { if(strstr($d,$url)) { echo "yes"; } } This works WITHOUT the text file, or array - but that's not what i want. I'd appreciate it if anyone can assist me.

    Read the article

  • Php read directory file

    - by kwek-kwek
    I have a script that goes through a directory that has 3 images $imglist=''; $img_folder = "path to my image"; //use the directory class $imgs = dir($img_folder); //read all files from the directory, checks if are images and ads them to a list while ($file = $imgs->read()) { if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file)) $imglist .= "$file "; } closedir($imgs->handle); //put all images into an array $imglist = explode(" ", $imglist); //display image foreach($imglist as $image) { echo '<img src="'.$img_folder.$image.'">'; } but the problem that I am having is it display a 4th img with no image.. yet I only have 3 image in that folder.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >