0

I have used the preg_Replace function in CorePHP as follows:

$d [] = preg_Replace("^0", "", $a);

But I'm getting the following error as:

Warning: preg_replace(): No ending delimiter '^'

What does the No ending delimiter mean? What am I missing here?

Dixon Chaudhary
  • 321
  • 1
  • 7
  • 21

1 Answers1

2

You need to slightly change your syntax to one of the following two options:

$d[] = preg_replace("/^0/", "", $a);

or

$d[] = preg_replace("(^0)", "", $a);

Demo

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360