No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
$rowA=array("-1","1","2","-2","3","-3","4"); $rowA['charge']= preg_replace("\-\1", " ", $rowA); How do i make this such that all numbers show up without negative signs on them? I also want "1" to be omitted from all results. So my results should only be 2,3 & 4 if i access the array. |
|
$rowB['charge']= preg_replace( $rowB['charge'] = 1||0||-1, " ", $rowB['charge']); Three things i want to do: 1. Is there a way replace the numbers -1, 0 and 1 with empty spaces but still have all the other numbers still show up i.e 2-9 & "-2" - "-9"? My preg_replace variations either does … |
|
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>SYNTHESIS REACTIONS</title> </head> <body> <p> Chemistry synthesis reaction equations </p> <p> </p> <form name="form1" method="post" action="index.php"> <p> <label for="A"></label> <input type="text" name="A" id="A"> + <input type="text" name="B" id="B"> <label for="B"></label> </p> <p>NB: Case Sensitive - Use Real Names!</p> <p> <input type="submit" name="solve" id="solve" … |