Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1034065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:19:55+00:00 2026-05-16T14:19:55+00:00

i am performing search condition of image file & using print_r() it shows output

  • 0

i am performing search condition of image file & using print_r() it shows output of image path in array. now i want to store this array & perform search operation for particular image path in that stored array.
this is code of searching image file:

$root1 = $_SERVER[‘DOCUMENT_ROOT’];

$directory = $root1.’/Place4Info/Data/Admin_data/’;

$it = new
RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
$i=0;
$num=1;
while($it->valid() and $iisDot()) {
$files = glob($directory.$it->getSubPath().’/*.jpg’);
print_r($files);

$i++;
}
$it->next(); }

& output is:

Array ( [0] => C:/Program
Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports19.jpg
[1] => C:/Program
Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports21.jpg
[2] => C:/Program
Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports22.jpg
[3] => C:/Program
Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports3.jpg
)

now i want store this output in a variable or in array.
after that i want to perform search action on that variable or array, like find the path of "C:/Program Files/EasyPHP-5.3.2i/www/Place4Info/Data/Admin_data/admin/sports22.jpg " file. & store that result in variable.
i got one code but i dont know how to apply this.

$conditions = array(“Post.title<>” =>
$files);
$this->Post->find(‘sports3.jpg’,
array(‘conditions’ => $conditions));
echo $this;

but it give error:

Fatal error: Using $this when not in object context in C:\Temp\test.php on line 17
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:19:55+00:00Added an answer on May 16, 2026 at 2:19 pm

    You’re misunderstanding the basics of PHP programming, my friend. Your question is not about how to use arrays but how to avoid a logic error in your programming. See my answer.

    $this is a magic variable that always represents the actual instance pointer of a substantiated class. E.g. it makes no sense to use it outside of a non-static class context, which is what you’re doing.

    Figure out which class has the correct Post object and use its API appropriately.

    e.g.

    $post = new Post;
    $post->find('sports3.jpg', array('conditions' => $conditions));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am performing a search in an XML file, using the following code: $result
I am using SOLR 1.3.0 for performing a distributed search over already existing lucene
I am having difficulties performing a search using Solr on certain fields. I am
I am working on text file..i want to know how to search for a
assume that we are performing search using keywords: keyword1, keyword2, keyword3 there are records
I am using NSPredicate for the performing Search as it does on iPhone when
Occasionally when performing a rebase using the MercurialEclipse plugin my repository gets thrown into
I'm performing a simulation of a simple queue using SimPy . One of the
I am currently using the following code to search within Tridion. It is fetching
I found a great tutorial on performing a faceted search. http://www.devatwork.nl/articles/lucenenet/faceted-search-and-drill-down-lucenenet/ This article does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.