Jump to content

[SOLVED] Fixing deprecated 'ereg' to 'preg_match' function?


random1

Recommended Posts

I have the following code working:

 

<?php
	if ( ereg('[0-9]*\.*[0-9]*', $version_number, $m ) )
	{
		$math_version_number = $m[0];
		//print_r($m);
	}
?>

 

But in the Apache error log it displays:

 

PHP Deprecated:  Function ereg() is deprecated

 

I then change it to the latest 'preg_match' function and try it and I get:

 

PHP Warning:  preg_match() [function.preg-match0]: Unknown modifier '*' in __________

 

How do you do a wildcard '*' in preg_match()?

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.