newb2php Posted March 19, 2010 Share Posted March 19, 2010 Hello all I am really new at all of this and really need some help. I have two php files that I need to merge. I've used winmerge to compare files, but i am seriously lost. There are a couple of snippets of code that I am really unsure of. Would I be able to post the files here? Would anyone be able to help me or steer me in the right direction? many thanks Quote Link to comment https://forums.phpfreaks.com/topic/195765-help-totally-lost/ Share on other sites More sharing options...
TapeGun007 Posted March 19, 2010 Share Posted March 19, 2010 Can you post the snippets of code? Quote Link to comment https://forums.phpfreaks.com/topic/195765-help-totally-lost/#findComment-1028405 Share on other sites More sharing options...
teamatomic Posted March 19, 2010 Share Posted March 19, 2010 What kind of files? php,txt?? And how do you want them merged? if they are two text files and you want one tagged onto the other then use file_put_contents with the APPEND flag. file_put_contents($file1, $file_2_add_on, FILE_APPEND | LOCK_EX); HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/195765-help-totally-lost/#findComment-1028419 Share on other sites More sharing options...
oni-kun Posted March 19, 2010 Share Posted March 19, 2010 Scripting languages are often apt. to easily integrate into eachother, if they are indeed just PHP code then try to copy->paste and see if it runs. You can go ahead from there and rename variables if needed etc. Remember, you can also include the file; such as include('filename.php'); and it will 'inherit' all its content. Quote Link to comment https://forums.phpfreaks.com/topic/195765-help-totally-lost/#findComment-1028422 Share on other sites More sharing options...
newb2php Posted March 19, 2010 Author Share Posted March 19, 2010 wow - thank you all so much for your replies; so - I've included the snippets of code from my 'winmerge' program (snippet from orig file followed by corresponding snippet from new file in the following cases), and would be grateful if you could please point me in the right direction as to merging? (I so apologize in advance - I know that this is very basic - but I'm willing to learn) 1. <<div class="text_v_c"><?php echo TEXT_VISITORS_CART; ?></div> <div class="forward"><?php echo TEXT_VISITORS_CART; ?></div> 2. <th scope="col" id="scRemoveHeading"><?php echo TABLE_HEADING_REMOVE; ?></th> <th scope="col" id="scRemoveHeading"> </th> 3. <div class="buttonRow"> </td> <td class="cartQuantityUpdate"> 4. ?></div> if ($product['checkBoxDelete'] ) { echo zen_draw_checkbox_field('cart_delete[]', $product['id']); } ?> 5. <div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <strong><?php echo $cartShowTotal; ?></strong></div> <div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $cartShowTotal; ?></div> Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/195765-help-totally-lost/#findComment-1028449 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.