vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Parsing/Evaling to return true or false (https://vborg.vbsupport.ru/showthread.php?t=50500)

Alcar Lazuli 03-20-2003 04:45 AM

Parsing/Evaling to return true or false
 
Say I had fields in a database that had:

PHP Code:

$sysstat == 

PHP Code:

empty($sysmessage

PHP Code:

$sysyes 

How would I go about parsing/evaling the codes to return a true or false value depending on the field in the database?

So if $sysstat equaled 2, then obvisously $sysstat == 1 would return false.

How would I go about doing this?

Thankyou.

Xenon 03-20-2003 11:15 AM

you just have to get em out of the db, whenever you use $blabl == blabla it will return true or false automatically

Alcar Lazuli 03-21-2003 09:51 AM

Well, whenever I do parse it to a function for the actual processing, it always ends up turning out from:

"$blahblah == 1" to "$1". Everything returns "$1".

Alcar...

filburt1 03-21-2003 10:55 AM

$1 isn't a legal variable name, how can anything return it?

Alcar Lazuli 03-21-2003 08:36 PM

Quote:

Today at 12:55 PM filburt1 said this in Post #4
$1 isn't a legal variable name, how can anything return it?
Yes I understand that, but can you not use those variables in preg_replace() ?

I'm actually taking apart a piece of text using:

PHP Code:

$text preg_replace("#<if \((.+?)\)>(.+?)(<else>(.+?)</else>)</if>#is"xscondition('$1''$2''$3'), $text); 

Now, I understand that the reason it is returning "$1" is because of the use of the single quotes, however I've tried most things, with trying to pass preg_replace() variables onto a function, and it just won't work.

Thankyou,
Alcar...


All times are GMT. The time now is 01:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00973 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete