Complex PHP Issue
I currently have a plugin which takes an input of keywords in txt format, then creates a .xml sitemap for each keyword.
In the sitemap there are 3 variables:
<loc>
<date>
<keyword>
I dont want it to create the
<date>
<keyword>
variable which is fine, I know how to do that.
But later on the plugin requires the <keyword> varibale as it uses this variable to post 50 random links at the end of each page.
This is the code used for that:
}
function get_footer_links()
{
$links = '';
$file = get_option('siteurl').'/sitemap.xml'; // Keyword-URL Filename
$xmlStr = file_get_contents($file);
$xmlObj = simplexml_load_string($xmlStr);
$arrXml = wsp_sfvp_objectsIntoArray($xmlObj);
$counter = 0;
if(is_array($arrXml) && count($arrXml)>0)
{
foreach($arrXml as $arr)
{
if(is_array($arr) && count($arr)>0)
{
shuffle($arr);
foreach($arr as $row)
{
$links .= "<a href='".$row['loc']."' target='_blank'>".$row['keyword']."</a><br/>";
$counter++;
if($counter>50) break;
What i would like, is for the [keyword] varibale to be taken from the URL.. so they sitemap <loc> would be www.sitename.com/key-word-1
I want the plugin to fill [keyword] with key word 1.
It will have to bascially rememove everything before the page title, and then remove '-' and insert a space.
I am hoping this can be done by modifiying the above code.
Could could anyone help me out with this?
SerpBook