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
  • 323
  • 1
  • 7
  • 18

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
  • 451,927
  • 24
  • 239
  • 318