Jump to content

Repeating a chunk of php


Canman2005

Recommended Posts

or oop

 

going with the function route though

 

do this in your script, or in an external script and include it at the top of your script

 

<?php

function anyoldnamewilldo()
{
//place code block to be repeated here
}

// later on in the script
anyoldnamewilldo();
anyoldnamewilldo();
?>

 

now your entire codeblock is inserted into the script twice

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.