i need to strip away the $_GET['id'] value from the end of $k. example name=address158, 158 is the id.. so is there away to strlens 158 from 'address' by using $_GET['id'] as the reference?
foreach($_POST as $k=>$v){
        @$select.=" `".mysql_real_escape_string($k)."` = '".mysql_real_escape_string($v)."',";
}
$select = rtrim($select,',');
$select = "UPDATE load_test SET".$select." WHERE Id=开发者_运维技巧".$_GET['id'];
mysql_query($select);
Something like this, perhaps?
$k = substr($k, 0, -strlen($_GET['id']));
I'm assuming that the identifier is always at the end of the string.
Lots of approaches here, depending on how strict your input is.
If you want to split by the = character: You could use strpos to find the = character, or you could use explode to split key and value.
If you want to use the ID, then you could use strrpos on the ID.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论