Jump to content

Merging a string inside a string.


XOpa

Recommended Posts

I'm confussed and annoyed at this. I have a string in my config file called
$Gallery_Name_1_NameDate = "TEST 1"; and
$Gallery_Name_2_NameDate = "TEST 2";

In one of the pages I have the URL string $gallery which is equal to Gallery_Name_1. but also it can be Gallery_Name_2.

Now, I need it so that the page echos out the TEST 1 bits by using the gallery URL string as a type of prefix. But i'm confussed how to add a string inside another string.

At the moment I've tried

<? echo "$".$gallery."_NameDate"; ?>
But that just outputs
$Gallery_Name_1_NameDate.

Which is near, but I dont want it in text, i need it as a string so it takes the $Gallery_Name_1_NameDate string from the config file using an include (which is in the page) and outputs TEST 1 instead of what it is now.

Rather confussing, but pleeeease help me :(

Regards
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.