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 8483921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:14:23+00:00 2026-06-10T20:14:23+00:00

The file below, can be setup using any JPG file from PhotoShop that has

  • 0

The file below, can be setup using any JPG file from PhotoShop that has XMP data. In the ‘pattern’, replace ‘eat:’ with ‘dc:’ or any namespace returned from the ‘$string’.

Calling $string (1) using following array setup it produces a print_r array that looks like: (2)

If you uncomment the line ubove (1a), it will print to the browse, copy & paste into the line below (1a). this should produce an array that looks like: (3)

Why the difference print_r readings, when it’s the same string?

How do I get it to behave like (3); … better yet how do I make it end up like the(4)?

<?php
header("Content-Type: text/html; charset=utf-8");
$filename = "2012-04-24_WestCoast_2.jpg";
echo '<img src="'. $filename . '" alt="'. $filename . '" title="' .     $filename . '" width="350" /><p />';
$source = file_get_contents($filename);
$xmpdata_start = strpos($source,'<x:xmpmeta');
$xmpdata_end = strpos($source,"</rdf:Description>");
$xmplenght = $xmpdata_end-$xmpdata_start;
$xmpdata = substr($source,$xmpdata_start,$xmplenght+18);
$string = htmlentities($xmpdata); //(1)

//if (is_string($string)) {
//    echo "is a string\n"; //TRUE
//} else {
//    echo "is not a string\n";
//}

//$string = print_r("'".$string."';");
// (1a)=====================================
//$string = '<x:xmpmeta xmlns: === Truncated for simplicity ===x="adobe:ns:meta/" x:xmptk="Adobe XMP Core    5.3-c011 66.145661, 2012/02/06-14:56:27 "> <rdf:RDF    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"></rdf:Description>';

$pattern = '/eat:(.*?)="(.*?)"/is';
preg_match_all($pattern, $string, $matches);
$group = array($matches[1], $matches[2]);
//    foreach($group as &$match);
echo '<pre>';
// print_r ($match);
print_r ($group);
echo '</pre>';
?>

(2)=====================================
// If i just call the ‘$string’, this is what i get:

Array
(
    [0] => Array
        (
        )

    [1] => Array
        (
        )

)

(3)=====================================
// If I uncomment (1), the ‘$string’ that I pasted inside the file, i get this:

Array
(
    [0] => Array
        (
            [0] => Biography
            [1] => Title
            [2] => object_description
            [3] => Medium
            [4] => in_height
            [5] => in_width
            [6] => in_depth
            [7] => Dated
            [8] => Photograph
        )

    [1] => Array
        (
            [0] => American B1942 Castine, Maine
            [1] => Reunion Dinner Party at the Slanted Door
            [2] => Nancy Freeman, Tim Patterson The Slanted Door San Francisco Calf.
            [3] => photography
            [4] => 2736
            [5] => 3648
            [6] => @ 240 dpi
            [7] => April 24, 2012
            [8] => PrimaryImage
        )

)

(4)=====================================
// This is what i’m trying to get too:

Biography: American B1942 Castine, Maine
Title: Reunion Dinner Party at the Slanted Door
object_description: Reunion Dinner Party at the Slanted Door
Nancy Freeman, Tim Patterson The Slanted Door San Francisco Calf.
Medium: photography
in_height: 2736
in_width: 3648
in_depth: @ 240 dpi
Dated: April 24, 2012
Photograph: PrimaryImage
  • 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-06-10T20:14:25+00:00Added an answer on June 10, 2026 at 8:14 pm

    Well it looks like i get to answer my own question of “Why it is a called ‘string’ invisible to an array?”.
    The answer is: When it’s preceded by a call to ‘htmlentities()’.

    Now I’m not really sure why it happens but it does happen and the instant I went back and checked all my assumptions … that ‘htmlentities()’ would clean up the raw string. Commenting out ‘htmlentities()’ made everything work.

    Is this a bug? I personally don’t know, and i don’t have the necessary experience using PHP to even hazard a guess. What i do know is it drove me up the wall for a week.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my .jsp file I have the code below. How can I compare the
I've attached a source file below, I'm kinda stuck. Basically, its an FLA that
I just setup PortablePython on my system, so I can run python scripts from
I am writing a custom c# HttpModule that will handle requests from all file
I have setup a routing table in the global.asax file for images that have
I'm using the following snippet of code to attempt to copy a file from
The htaccess file below crashed the site with an internal server error (500). This
Why does this graphml file below does not render the node color properly in
How do I change my XML file below to have CAS return to the
I have written the batch file below, in order to automate the process of

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.