Jump to content

I have a variable. How do i parse its contents?


zbrahead

Recommended Posts

You can't execute PHP code that way (if that's what you are after).

For pulling something out of a string (maybe the url, in this case?), there's lots of useful functions for example preg_match() and strstr()

Good question is, why would you have something like that in a variable...
Link to comment
Share on other sites

If that is the code in your mysql database then you'll want use eval in order run the PHP code that is stored in your database.

for example when you get it out of your database you'll want to do something like this:

[code=php:0]eval("$your_var = \"$row['column_name_here']\";");[/code]
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.