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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:10:50+00:00 2026-05-26T13:10:50+00:00

SCROLL DOWN if you just want to see the question without much explanation I

  • 0

SCROLL DOWN if you just want to see the question without much explanation

I have kind of a big application with a lot of values that are used as options. The control for the application is a website, application itself is C++ and all the options are stored inside MySQL so that both C++ and php can access it.
So I am using php to read bunch of values from a text file, and auto generate SQL, C++ and php code, since the options are used everywhere and are so massive that it would take too long to implement them, and would be too much of a hassle to add an extra options in the future.

This is what one line of my text file looks like

`input_video_standard`|:|INT|:|NOT NULL DEFAULT '0'|:|profile->input.videoStandard|:|Video Standard|:|SD 576i@50Hz (B,G/PAL)|:|SD 480i@59.94Hz (NTSC)|:|HD 720p@50Hz|:|HD 720p@59.94Hz|:|HD 1080i@25Hz|:|HD 1080i@29.97Hz

Once I read in that line I use

$pieces = explode("|:|", $line);

This part is for generating C++ code now
I have an array called variables, where I store name of the variable for C++ and what type it is.

$variables[] = array($pieces[1], $pieces[3]);

Once I loop through the text file and gather up all the data

I try to create a string which I will later on store inside a text file

$cpp .= "memset(prof,0,sizeof(prof));\n";
$cpp .= "sprintf(prof, \"CALL put_into_input(%d, 'test'";
for($i = 3; $i<count($variables); $i++)
{
    if(strpos($variables[0], "VARCHAR") === FALSE)
    {
        $cpp .= ", %d";
    }
    else
    {
        $cpp .= ", '%s'";
    }
}
$cpp .= "\nprofile-".">"."pfile";
for($i = 3; $i<count($variables); $i++)
{
    $cpp .= ",\n".$variables[1];
}
$cpp .= ");\n";

THE QUESTION

The problem is that when I try to concatenate string profile->input.videoStandard to my main string it simply saves it as Array, and I have noticed that php does not like -> as a string in general, which is why I used “-“.”>” wherever I could. How do I go about getting php of accepting -> as a string?

Thanks to anyone for their help.

  • 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-26T13:10:51+00:00Added an answer on May 26, 2026 at 1:10 pm

    I have noticed that php does not like -> as a string in general.

    Nothing wrong with a -> in a string.

    Unless there is some $ in there too.

    This will cause PHP to think you are trying to access a property of an object instance.

    E.g. $object->something. You could just use single quotes in stead of double quotes to prevent PHP trying to parse the string. Other than that there shouldn’t be any problem using -> in a string.

    EDIT

    You’re code looks strange to me.

    You are doing $variables[] = array($pieces[1], $pieces[3]);

    which is the same as $variables = array(array($pieces[1], $pieces[3]));

    So you only have $variables[0] and not $variables[1]

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

Sidebar

Related Questions

I want to load my data on scroll down for my tableView. I have
What I want is use an effect that is much smoother to scroll down
On hover I want my div to scroll down. I know i can use
I want to implement Paginated list View in android so when I scroll down
If you go to http://www.foxnews.com , and scroll down a little you would see
Scroll down to the bottom of this post to see a work around /
I want to mimic behaviour with jQuery like you can see here: http://edo.webmaster.am/ Just
Is it possible to scroll down the left and right parts of a vertically
If you scroll down to the section 'Writing to Files and URLs' at this
When you scroll down to the bottom of http://www.dzone.com/links/ it automatically loads more links.

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.