473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Handle String-Variable as mathematical order

Hi there,

i just wondered if it is possible to handle a string variable as a
mathematical order.

If the variable contains i.e. "2*100" PHP should calculate it, so that i'm
able to assign the the result to another variable.
How can i realise this if it is possible
Thanks for the help,
Johannes
Jul 17 '05 #1
2 1562
"MatrixCrawler" <j.***********@t-online.de> wrote in message
news:cl*************@news.t-online.com...
Hi there,

i just wondered if it is possible to handle a string variable as a
mathematical order.

If the variable contains i.e. "2*100" PHP should calculate it, so that i'm
able to assign the the result to another variable.
How can i realise this if it is possible
Thanks for the help,
Johannes


Tested:

<?php
$math = "2*100";
eval("\$math2 = $math;");
print $math2;
?>
Jul 17 '05 #2
Thank you for the help!

Works perfectly for me!
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil B Brubaker | last post by:
I'm trying to create my own shellexecute program named shell4OD and am having problems with handles. Here is my code ... ===== Private Declare Function ShellExecute Lib _ "shell32.dll" Alias...
7
by: Tony Johansson | last post by:
Hello!! Assume I have a handle body pattern with classes called Handle and Body. In the Body class I store one int value for example 7 or some other integer value. In the Handle class I have...
4
by: Terry | last post by:
There are a number of things about using unmanaged resources in Windows Forms programming that is unclear to me. In C++, if you loaded an icon resource using "ExtractIcon()", the resource was...
6
by: Wes | last post by:
Hello, I am writing a class in C# that uses to call functions from a C++ dll. Evenything seems to work fine call the functions except one of the functions takes a *File as a parameter. Many...
6
by: Leandro Berti via DotNetMonster.com | last post by:
Hi All, I wrote a code to do serial communication with an equipament. When i use the code outside of threaded class it seens work properly, but when i put inside a class and execute a thread in...
2
by: Schorschi | last post by:
Can't seemd to get ReadFile API to work! Returns invalid handle error? =========================================================================== Ok, the visual basic gurus, help! The...
6
by: anonymous | last post by:
hi all, I'm trying to use the capCreateCaptureWindow (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_capcreatecapturewindow.asp) in a Windows...
2
by: Gary Wessle | last post by:
Hi I need help organizing this program in the right way. I included the code below which compiles and runs and gives the desired effect to a certain point, but I don't know what the next step...
6
by: sergey | last post by:
I'm new to C++ and I need to create DB connection pool. Here is the class that I have: class uudb { public: uudb(); ~uudb();
2
weaknessforcats
by: weaknessforcats | last post by:
Handle Classes Handle classes, also called Envelope or Cheshire Cat classes, are part of the Bridge design pattern. The objective of the Bridge pattern is to separate the abstraction from the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.