Excluding Part of a Variable
Posted: Wed Sep 10, 2003 11:56 am
I am using this to create a link to a php page:
zenoview.php?m=<?php echo $m; ?>&c=<?php echo $c; ?>
Next I want to add to the M variable in order to call a different set of images and text (see where I have added the _mt) :
zenoview.php?m=<?php echo $m; ?>_mt&c=<?php echo $c; ?>
This adds _mt to the M (model # variable) which in turn calls the existing variable with _mt added to it.
Now I need to figure out how to subtract that _mt addition on the next page using the same echo function since now the echo $m being used on that page will now be including the _mt within it.
In short, how do I subtract or exclude a portion of a variable?
Example...if m=123456_x and i want to use the function above to call it without the _x at the end.
zenoview.php?m=<?php echo $m; ?>&c=<?php echo $c; ?>
Next I want to add to the M variable in order to call a different set of images and text (see where I have added the _mt) :
zenoview.php?m=<?php echo $m; ?>_mt&c=<?php echo $c; ?>
This adds _mt to the M (model # variable) which in turn calls the existing variable with _mt added to it.
Now I need to figure out how to subtract that _mt addition on the next page using the same echo function since now the echo $m being used on that page will now be including the _mt within it.
In short, how do I subtract or exclude a portion of a variable?
Example...if m=123456_x and i want to use the function above to call it without the _x at the end.