ok, i managed to get it to work with this
$amount1 = $invoice_amount;
$operator = $invoice_operator;
$amount2 = $invoice_multiplier;
$rvalue = mcalc ($amount1,$operator,$amount2);
function mcalc ($amount1,$operator,$amount2) {
if($operator=="+")
$result=$amount1+$amount2;
else if($operator=="-")
$result=$amount1-$amount2;
else if($operator=="x")
$result=$amount1*$amount2;
else if($operator=="/")
$result=$amount1/$amount2;
return $result;
}
echo $rvalue;
Related Posts:
- How can I fetch data from another website to my wordpress website with mysql database
- WP Function does not trigger on Webhook API Call
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- Plugin update error message
- How to Loop Plugin Option Field Set?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Set a User as Author of all ‘New Posts’ posted
- Post source link plugin – small modification
- Change destination author link
- HELP: Integrating WP with raw PHP code once published button is hit
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Modifying Footnote Plugin for Descriptive Title Attributes
- I would like to use create a function in my custom plugin to tell WP to use a different header
- New Plugin: Post update pushes a copy as a revision
- bulk change of image setting “link to” to “link to: image url “
- Scope for PHP Variables Assigned in functions.php or a plugin
- How to get post URL in the_content filter?
- How to write one comment and publish on every post using database or plugin?
- How to get number of Affected rows from wordpress dbDelta() function
- add_query_arg not working
- Executing my function once on a specific time
- How to stop or remove an action being called inside a function of an extended class
- wordpress plugin is not activating from widget
- Theme my Login plugin, how to update fields
- How to simultaneously access the same MySQL database in the main column and sidebar of WordPress?
- Date calculations from 2 custom fields
- How to enable specific plugin only based around shop manager role?
- WpDataTables – View Image Directory
- get current date + 90 days and checking every day
- Adding a new field to the address field type in gravity forms
- Nested shortcode functions accessing variable
- Customize permalink wordpress category id
- WP Query. Is there a maximum size?
- Redirect to another page using contact form 7? [closed]
- Load Javascript from Plugin in One Page Only?
- Checking the count within a foreach loop
- execute function after one completed
- wp_dequeue_script for a Plugin
- Need to replace Currency Shortforms
- How to get specific string/value from an array? php [closed]
- How to translate wordpress error message
- Api external with wordpress
- All custom widgets are not showing in widget area at the same time
- speed up pagination for huge database
- Way to send multiple values for column to MySQL?
- More gentle way to hook WordPress custom url
- How to display results from a data table with an encrypted user id?
- How to add custom function to pluggable.php
- Can you echo PHP code from a variable?
- add_action for publish_post doesn’t work
- Checkbox show / hide output result
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Custom Logo Link WordPress
- How to convert Currency from USD to other IP Based currency in Php function
- Getting current user data with MySQL statement
- how to validate input field in wordpress generated with wpform plugin
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- Attempting to list all product categories and the price range of all products within them
- Cant create table on plugin activation
- Creating an array from form inputs before it is posted to the options database
- Share my WordPress plugin for updating how?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- adding dynamic/multiple slug values in ‘option_none_value’
- Submitting form to PHP
- How to assign a specific service to a specific provider based on location
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- working code, not working – Plugin Dev
- Moving a few select DB tables to a new WP instance
- Is admin section completely customizable in terms of styling?
- Configuring default woo commerce login with modal popup
- How to make the first letter of a post title uppercase, in a plugin?
- Compare Ajax Data Results
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- register_activation_hook doesn’t fire at all
- Migrating custom php we wrote from functions.php into a site-specific plugin
- Nested DIV’s across functions in PHP, do not seem to work
- My ajax request don´t work and return 0
- Every time I use wp_get_current_user() my plugin breaks
- Create csv file in plugin
- Cannot access variables within a widget
- Posting code inside the post instead of in the template file using shortcode
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- Metabox Data not saving
- How to add a handler for a button in plugin?
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Doing action based on input from options menu
- Including a PHP file via a function that is part of a plugin?
- How to disable register and reset the password from WordPress admin panel?
- Move related products after product summary? [closed]
- How to tweak a plugin without preventing it from updating
- how to search through plugin in wordpress cimy-user-extra-fields?
- Adminimize Plugin — Is there an alternative to limiting Editor to ‘Appearance > Widgets’ only?
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Woocommerce disable checkout on specific day
- Adding a script & php to functions.php
- Option value not getting updated until page refresh in WordPress
- Make plugin admin page visible to other roles
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)