I have delared variables like this. I have created more than 100 variables in every page.
<?php echo $rsedit[customer_name]; ?>
<?php echo $rsedit[address]; ?>
<?php echo $rsedit[city]; ?>
<?php echo $rsedit[pincode]; ?>
<?php echo $rsedit[contact_no]; ?>
<?php echo $rsedit[email_id]; ?>
I am searching and replacing in notepad++. But it takes long time.
I want following output:
<?php echo $rsedit['customer_name']; ?>
<?php echo $rsedit['address']; ?>
<?php echo $rsedit['city']; ?>
<?php echo $rsedit['pincode']; ?>
<?php echo $rsedit['contact_no']; ?>
<?php echo $rsedit['email_id']; ?>
Tell me the best solution for this to replace together.
I would use the following find and replace, in regex mode:
Find: <\?php echo \$(.*?)\[(.*?)\];\s*\?>
Replace: <?php echo \$$1['$2']; ?>