ShivaGupta Posted January 12, 2014 Share Posted January 12, 2014 i am working with this code . <?php $str = ' 1 + 1+ 1 '; $str = str_replace(' ', '', $str); preg_match('/(?P<one>\d+)[+-](?P<two>\d+)[+-](?P<three>\d+)/', $str, $matches); $user = $matches[0]; ?> then here i want result as 3 plz help me how to do Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted January 12, 2014 Share Posted January 12, 2014 Have a read of this thread http://forums.phpfreaks.com/topic/283274-simple-math-problem/ You should be able to find a solution within there. Quote Link to comment Share on other sites More sharing options...
ShivaGupta Posted January 12, 2014 Author Share Posted January 12, 2014 (edited) Have a read of this thread http://forums.phpfreaks.com/topic/283274-simple-math-problem/ You should be able to find a solution within there. after read that threed steel i have provlem.......... i am using a temp soltuion first save as php then include that php $sym1 = "$"; $sym2 = "user"; $sym3 = "<?php $sym1$sym2 = ( $user ); ?>"; $st='user.php'; file_put_contents($st, $sym3); include("user.php"); and it working fine but i want other soltuion ........... Edited January 12, 2014 by ShivaGupta Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.