I have a variable $allrule = '(1 == 2) && (2 == 2)';
when i check if($allrule), it returns true because $allrule is treated as string. So i want to convert $allrule as condition of if statement. how can we do it.
Convert string to variable in PHP
721 Views Asked by Priye Ranjan At
1
There are 1 best solutions below
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in STRING
- SML - Find same elements in a string
- match hex string with list indice
- How can I determine the index of the same set of characters between two strings that are of different lengths?
- String.replace() isn't working like I expect
- How to do a case-insensitive string comparison?
- Trying to save an np array with string and floats, but getting a error
- String replace with integer not working
- How to calculate a length of array with out using library
- Java replace every Nth specific character (e.g. space) in String
- Split the strings into two parts Python
- Perl Regex: Merge multiple one-character substrings
- Squid S2275 does not know about format string argument indexes
- more efficient way of remove a few characters from the end of a string
- python member str performance too slow
- String.split() not behaving in android
Related Questions in IF-STATEMENT
- If...Then...Else Visual Basic 2012
- Why does compiler recognize while(true) at compile time but not if(true)
- Swift 2 - Pattern matching in "if"
- How to get a text to display on vba when a button is pressed?
- PHP statements with <<<EOF string
- Convert string to variable in PHP
- Are the conditional statements if(true) and if(false) evaluated at compile time in java?
- Compare strings using ==
- SQL Several Count
- how to get user to pick inputs Java
- WHERE Clause in SQL statement with 2 conditions
- PHP: most efficient way of structuring IF clauses
- Python - Why is my else statement being ignored in this piece of code?
- Multiple conditions in Java
- C program treats an if statement as false when it is in fact true
Related Questions in CONDITIONAL-STATEMENTS
- How can I fix my code to do line by line conditional statements in Matlab
- SQL Conditional Join on Columns
- Syntax error in Perl open
- Convert string to variable in PHP
- SQL Several Count
- Is it possible to implement a conditional attribute on a field in Odoo?
- Conditional subtraction Part 2
- Conditional subtraction
- Conditional Logic for links in ACF
- Assignment in conditional expressions - what are the potential code quality consequences of this?
- If condition doesn't allow to leave empty fields
- jade mixin, conditional leave out
- Show text for post with specific date and specific category in Wordpress
- Second conditional statement not working in assembly
- Gnuplot: Conditional splot of a function
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This solution uses eval() which is pure evil, but since it wasn't stipulated not to do so...
Expanded Example*:
*from comments