thanks for reading.
So ok this is what I been working on.
I’m making object’s, inside my function that contains data for each city in the USA.

The information displays in a custom template that has most of the information for each page.

The objects just change parts of the text like words and sentences.
That’s why each object needs to be unique.

My question to the StackOverflow community is, is there a way to achieve this faster?

I’m new to PHP but trying really hard.
Or how can I make the memory on word press unlimited so I can fit this huge database?
That’s a lot of cities!

Thanks for reading.

example:

<?php
/**
* Enqueues child theme stylesheet, loading first the parent theme stylesheet.
*/
function themify_custom_enqueue_child_theme_styles() {
	wp_enqueue_style( 'parent-theme-css', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'themify_custom_enqueue_child_theme_styles', 11 );


/****THIS FUNCTION CONTROLS THE CITY DATA BASE!*****/
function get_city_info() {
	 $_SERVER['REQUEST_URI'];
	$city_info = [

		'/pageone/denver/' => [
			'city' => 'Denver',
			'state' => 'Colorado',
			'description' => 'Denver description',
			'links' => [
				'lakes' => 'fishing',
				'mountains' => 'snow',
				'hike-trails' => 'road',
				'camping' => 'park'
			]
		],

		'/pageone/california/irvine/' => [
			'city' => 'Irvine',
			'state' => 'California',
			'description' => 'Irvine description',
			'links' => [
				'lakes' => 'fishing',
				'mountains' => 'snow',
				'hike-trails' => 'road',
				'camping' => 'park'
			]
		]
	];

	$default = [
		'city' => '',
		'state' => '',
		'description' => '',
		'links' => [
		]
	];
	return isset($city_info[$_SERVER['REQUEST_URI']]) ? $city_info[$_SERVER['REQUEST_URI']] : $default;

}
/***********************************************************/


 

Read more here: is there a way to do this faster? php function database-read plesae if interested


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: